Package org.bouncycastle.tsp.ers
Class ERSEvidenceRecord
java.lang.Object
org.bouncycastle.tsp.ers.ERSEvidenceRecord
RFC 4998 Evidence Record.
-
Constructor Summary
ConstructorDescriptionERSEvidenceRecord
(byte[] evidenceRecord, DigestCalculatorProvider digestCalculatorProvider) ERSEvidenceRecord
(InputStream ersIn, DigestCalculatorProvider digestCalculatorProvider) ERSEvidenceRecord
(org.bouncycastle.asn1.tsp.EvidenceRecord evidenceRecord, DigestCalculatorProvider digestCalculatorProvider) -
Method Summary
Modifier and TypeMethodDescriptiongenerateHashRenewalRequest
(DigestCalculator digCalc, ERSData data, TimeStampRequestGenerator tspReqGen) generateHashRenewalRequest
(DigestCalculator digCalc, ERSData data, TimeStampRequestGenerator tspReqGen, BigInteger nonce) generateTimeStampRenewalRequest
(TimeStampRequestGenerator tspReqGen, BigInteger nonce) byte[]
return the ASN.1 encoded representation of this object.byte[]
Return the timestamp imprint for the initial ArchiveTimeStamp in this evidence record.Return the TimeStamp signing certificate if it is present.boolean
isContaining
(ERSData data, Date date) Return true if the hash of data appears in the primary archive time stamp for the current chain.boolean
Return true if this evidence record is related to the passed in one.renewHash
(DigestCalculator digCalc, ERSData data, TimeStampResponse tspResp) renewTimeStamp
(TimeStampResponse tspResp) org.bouncycastle.asn1.tsp.EvidenceRecord
void
validate
(SignerInformationVerifier verifier) Validate the current time stamp associated with this evidence record.void
validatePresent
(boolean isDataGroup, byte[] hash, Date atDate) Validate that a particular data object/group is present by hash.void
validatePresent
(ERSData data, Date atDate) Validate that a particular data object/group is present.
-
Constructor Details
-
ERSEvidenceRecord
public ERSEvidenceRecord(InputStream ersIn, DigestCalculatorProvider digestCalculatorProvider) throws TSPException, ERSException, IOException - Throws:
TSPException
ERSException
IOException
-
ERSEvidenceRecord
public ERSEvidenceRecord(byte[] evidenceRecord, DigestCalculatorProvider digestCalculatorProvider) throws TSPException, ERSException - Throws:
TSPException
ERSException
-
ERSEvidenceRecord
public ERSEvidenceRecord(org.bouncycastle.asn1.tsp.EvidenceRecord evidenceRecord, DigestCalculatorProvider digestCalculatorProvider) throws TSPException, ERSException - Throws:
TSPException
ERSException
-
-
Method Details
-
getPrimaryRootHash
Return the timestamp imprint for the initial ArchiveTimeStamp in this evidence record.- Returns:
- initial hash root.
- Throws:
TSPException
ERSException
-
isRelatedTo
Return true if this evidence record is related to the passed in one.- Parameters:
er
- the evidence record to be checked.- Returns:
- true if the primary time stamp has the same value, false otherwise.
-
isContaining
Return true if the hash of data appears in the primary archive time stamp for the current chain.- Parameters:
data
- the data of interest.- Returns:
- Throws:
ERSException
-
validatePresent
Validate that a particular data object/group is present.- Parameters:
data
- the data object/group.atDate
- date at which data is supposed to be valid.- Throws:
ERSException
- if the object cannot be found or the record is invalid.
-
validatePresent
Validate that a particular data object/group is present by hash.- Parameters:
isDataGroup
- true if hash represents a data group.hash
- expected hash valueatDate
- date at which value is supposed to be valid.- Throws:
ERSException
- if the object cannot be found or the record is invalid.
-
getSigningCertificate
Return the TimeStamp signing certificate if it is present.- Returns:
- the TimeStamp signing certificate.
-
validate
Validate the current time stamp associated with this evidence record.- Parameters:
verifier
- signer verifier for the contained time stamp.- Throws:
TSPException
- in case of validation failure or error.
-
toASN1Structure
public org.bouncycastle.asn1.tsp.EvidenceRecord toASN1Structure() -
getEncoded
return the ASN.1 encoded representation of this object.- Throws:
IOException
-
generateTimeStampRenewalRequest
public TimeStampRequest generateTimeStampRenewalRequest(TimeStampRequestGenerator tspReqGen) throws TSPException, ERSException - Throws:
TSPException
ERSException
-
generateTimeStampRenewalRequest
public TimeStampRequest generateTimeStampRenewalRequest(TimeStampRequestGenerator tspReqGen, BigInteger nonce) throws ERSException, TSPException - Throws:
ERSException
TSPException
-
renewTimeStamp
public ERSEvidenceRecord renewTimeStamp(TimeStampResponse tspResp) throws ERSException, TSPException - Throws:
ERSException
TSPException
-
generateHashRenewalRequest
public TimeStampRequest generateHashRenewalRequest(DigestCalculator digCalc, ERSData data, TimeStampRequestGenerator tspReqGen) throws ERSException, TSPException, IOException - Throws:
ERSException
TSPException
IOException
-
generateHashRenewalRequest
public TimeStampRequest generateHashRenewalRequest(DigestCalculator digCalc, ERSData data, TimeStampRequestGenerator tspReqGen, BigInteger nonce) throws ERSException, TSPException, IOException - Throws:
ERSException
TSPException
IOException
-
renewHash
public ERSEvidenceRecord renewHash(DigestCalculator digCalc, ERSData data, TimeStampResponse tspResp) throws ERSException, TSPException - Throws:
ERSException
TSPException
-