Top Description Fields Constructors Methods
org.bouncycastle.tsp.ers

public Class ERSDataGroup

extends ERSCachingData
Class Inheritance
Known Direct Subclasses
org.bouncycastle.tsp.ers.ERSDirectoryDataGroup
Imports
java.util.ArrayList, .Arrays, .Collections, .List, org.bouncycastle.operator.DigestCalculator

Representation of data groups with more than 1 members according to the description provided in RFC4998.

Such data groups represent a set of one or more data objects (e.g. electronic documents) for which an Evidence Record should be generated. Data groups will be encapsulated in a single PartialHashtree so that the presence of the group can be checked for, as well as the individual items that make it up.

Field Summary

Modifier and TypeField and Description
protected List<ERSData>

Constructor Summary

AccessConstructor and Description
public
ERSDataGroup(ERSData...
an array of data objects.
dataObjects
)

Base constructor for an "array" of data objects.

public
ERSDataGroup(List<ERSData>
a list of data objects.
dataObjects
)

Base constructor using a list of data objects.

public
ERSDataGroup(ERSData
the data object to go in the group.
dataObject
)

Constructor for a group with a single object.

Method Summary

Modifier and TypeMethod and Description
protected byte[]

Returns:

a hash that is representative of the whole DataGroup
calculateHash
(DigestCalculator
the DigestCalculator to use for computing the hash
digestCalculator
,
byte[] previousChainHash)

Implements abstract org.bouncycastle.tsp.ers.ERSCachingData.calculateHash.

Generates a hash for the whole DataGroup.

public byte[]

Returns:

calculated hash.
getHash
(DigestCalculator
digest calculator to use.
digestCalculator
,
byte[]
hash from an earlier chain if it needs to be included.
previousChainHash
)

Overrides org.bouncycastle.tsp.ers.ERSCachingData.getHash.

Implements org.bouncycastle.tsp.ers.ERSData.getHash.

Return the calculated hash for the Data

public List<byte[]>

Returns:

the set of hashes, in ascending order
getHashes
(final DigestCalculator
the DigestCalculator to use for computing the hashes
digestCalculator
,
final byte[] previousChainHash)

Generates hashes for all the data objects included in the data group with a previous chain hash.

public int

Returns:

membership count of the group.
size
()

Return the number of data objects present in the group.

Field Detail

dataObjectsback to summary
protected List<ERSData> dataObjects

Constructor Detail

ERSDataGroupback to summary
public ERSDataGroup(ERSData... dataObjects)

Base constructor for an "array" of data objects.

Parameters
dataObjects:ERSData[]

an array of data objects.

ERSDataGroupback to summary
public ERSDataGroup(List<ERSData> dataObjects)

Base constructor using a list of data objects.

Parameters
dataObjects:List<ERSData>

a list of data objects.

ERSDataGroupback to summary
public ERSDataGroup(ERSData dataObject)

Constructor for a group with a single object.

Parameters
dataObject:ERSData

the data object to go in the group.

Method Detail

calculateHashback to summary
protected byte[] calculateHash(DigestCalculator digestCalculator, byte[] previousChainHash)

Implements abstract org.bouncycastle.tsp.ers.ERSCachingData.calculateHash.

Generates a hash for the whole DataGroup.

Parameters
digestCalculator:DigestCalculator

the DigestCalculator to use for computing the hash

Returns:byte[]

a hash that is representative of the whole DataGroup

getHashback to summary
public byte[] getHash(DigestCalculator digestCalculator, byte[] previousChainHash)

Overrides org.bouncycastle.tsp.ers.ERSCachingData.getHash.

Implements org.bouncycastle.tsp.ers.ERSData.getHash.

Return the calculated hash for the Data

Parameters
digestCalculator:DigestCalculator

digest calculator to use.

previousChainHash:byte[]

hash from an earlier chain if it needs to be included.

Returns:byte[]

calculated hash.

getHashesback to summary
public List<byte[]> getHashes(final DigestCalculator digestCalculator, final byte[] previousChainHash)

Generates hashes for all the data objects included in the data group with a previous chain hash.

Parameters
digestCalculator:DigestCalculator

the DigestCalculator to use for computing the hashes

Returns:List<byte[]>

the set of hashes, in ascending order

sizeback to summary
public int size()

Return the number of data objects present in the group.

Returns:int

membership count of the group.