Class ERSArchiveTimeStampGenerator
java.lang.Object
org.bouncycastle.tsp.ers.ERSArchiveTimeStampGenerator
Generator for RFC 4998 ArchiveTimeStamps. Data objects (and data groups) are
added, reduced to a single root hash via the Merkle hash tree built over their
PartialHashtree leaves, and a time-stamp request for that root is produced; the
returned time-stamp response is then turned into one or more
ERSArchiveTimeStamps carrying the reduced hash tree for each object.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddAllData(List<ERSData> dataObjects) Add a list of data objects (or data groups) to be covered by the archive time-stamp.voidAdd a data object (or data group) to be covered by the archive time-stamp.generateArchiveTimeStamp(TimeStampResponse tspResponse) Generate a single ArchiveTimeStamp from the passed in time-stamp response.generateArchiveTimeStamps(TimeStampResponse tspResponse) Generate one ArchiveTimeStamp per added data object from the passed in time-stamp response, each carrying the reduced hash tree (the sibling path through the Merkle tree) needed to recover the time-stamped root for that object.generateTimeStampRequest(TimeStampRequestGenerator tspReqGenerator) Generate a time-stamp request for the root hash of the Merkle tree built over the data objects added so far.generateTimeStampRequest(TimeStampRequestGenerator tspReqGenerator, BigInteger nonce) Generate a time-stamp request for the root hash with the passed in nonce.
-
Constructor Details
-
ERSArchiveTimeStampGenerator
-
-
Method Details
-
addData
Add a data object (or data group) to be covered by the archive time-stamp.- Parameters:
dataObject- the data object/group to add.
-
addAllData
-
generateTimeStampRequest
public TimeStampRequest generateTimeStampRequest(TimeStampRequestGenerator tspReqGenerator) throws TSPException, IOException Generate a time-stamp request for the root hash of the Merkle tree built over the data objects added so far.- Parameters:
tspReqGenerator- generator to use for building the request.- Returns:
- a time-stamp request over the computed root hash.
- Throws:
TSPException- on a time-stamp processing error.IOException- on an encoding error.
-
generateTimeStampRequest
public TimeStampRequest generateTimeStampRequest(TimeStampRequestGenerator tspReqGenerator, BigInteger nonce) throws TSPException, IOException Generate a time-stamp request for the root hash with the passed in nonce.- Parameters:
tspReqGenerator- generator to use for building the request.nonce- nonce to include in the request.- Returns:
- a time-stamp request over the computed root hash.
- Throws:
TSPException- on a time-stamp processing error.IOException- on an encoding error.
-
generateArchiveTimeStamp
public ERSArchiveTimeStamp generateArchiveTimeStamp(TimeStampResponse tspResponse) throws TSPException, ERSException Generate a single ArchiveTimeStamp from the passed in time-stamp response. The response's imprint must match the algorithm and root hash of the data added; this form requires exactly one data object (one reduced hash tree).- Parameters:
tspResponse- the response carrying the time-stamp over the root hash.- Returns:
- the ArchiveTimeStamp covering the added data.
- Throws:
TSPException- if the response has an error status or its imprint does not match.ERSException- if more than one reduced hash tree is present, or on a processing error.
-
generateArchiveTimeStamps
public List<ERSArchiveTimeStamp> generateArchiveTimeStamps(TimeStampResponse tspResponse) throws TSPException, ERSException Generate one ArchiveTimeStamp per added data object from the passed in time-stamp response, each carrying the reduced hash tree (the sibling path through the Merkle tree) needed to recover the time-stamped root for that object.- Parameters:
tspResponse- the response carrying the time-stamp over the root hash.- Returns:
- a list of ArchiveTimeStamps, one per data object, in the order the data was added.
- Throws:
TSPException- if the response has an error status or its imprint does not match.ERSException- on a processing error.
-