Package org.bouncycastle.tsp.ers
Class ERSEvidenceRecord
- java.lang.Object
-
- org.bouncycastle.tsp.ers.ERSEvidenceRecord
-
public class ERSEvidenceRecord extends java.lang.Object
RFC 4998 Evidence Record.
-
-
Constructor Summary
Constructors Constructor Description ERSEvidenceRecord(byte[] evidenceRecord, org.bouncycastle.operator.DigestCalculatorProvider digestCalculatorProvider)
ERSEvidenceRecord(java.io.InputStream ersIn, org.bouncycastle.operator.DigestCalculatorProvider digestCalculatorProvider)
ERSEvidenceRecord(org.bouncycastle.asn1.tsp.EvidenceRecord evidenceRecord, org.bouncycastle.operator.DigestCalculatorProvider digestCalculatorProvider)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TimeStampRequest
generateHashRenewalRequest(org.bouncycastle.operator.DigestCalculator digCalc, ERSData data, TimeStampRequestGenerator tspReqGen)
TimeStampRequest
generateHashRenewalRequest(org.bouncycastle.operator.DigestCalculator digCalc, ERSData data, TimeStampRequestGenerator tspReqGen, java.math.BigInteger nonce)
TimeStampRequest
generateTimeStampRenewalRequest(TimeStampRequestGenerator tspReqGen)
TimeStampRequest
generateTimeStampRenewalRequest(TimeStampRequestGenerator tspReqGen, java.math.BigInteger nonce)
byte[]
getEncoded()
return the ASN.1 encoded representation of this object.byte[]
getPrimaryRootHash()
Return the timestamp imprint for the initial ArchiveTimeStamp in this evidence record.X509CertificateHolder
getSigningCertificate()
Return the TimeStamp signing certificate if it is present.boolean
isContaining(ERSData data, java.util.Date date)
Return true if the hash of data appears in the primary archive time stamp for the current chain.boolean
isRelatedTo(ERSEvidenceRecord er)
Return true if this evidence record is related to the passed in one.ERSEvidenceRecord
renewHash(org.bouncycastle.operator.DigestCalculator digCalc, ERSData data, TimeStampResponse tspResp)
ERSEvidenceRecord
renewTimeStamp(TimeStampResponse tspResp)
org.bouncycastle.asn1.tsp.EvidenceRecord
toASN1Structure()
void
validate(SignerInformationVerifier verifier)
Validate the current time stamp associated with this evidence record.void
validatePresent(boolean isDataGroup, byte[] hash, java.util.Date atDate)
Validate that a particular data object/group is present by hash.void
validatePresent(ERSData data, java.util.Date atDate)
Validate that a particular data object/group is present.
-
-
-
Constructor Detail
-
ERSEvidenceRecord
public ERSEvidenceRecord(java.io.InputStream ersIn, org.bouncycastle.operator.DigestCalculatorProvider digestCalculatorProvider) throws TSPException, ERSException, java.io.IOException
- Throws:
TSPException
ERSException
java.io.IOException
-
ERSEvidenceRecord
public ERSEvidenceRecord(byte[] evidenceRecord, org.bouncycastle.operator.DigestCalculatorProvider digestCalculatorProvider) throws TSPException, ERSException
- Throws:
TSPException
ERSException
-
ERSEvidenceRecord
public ERSEvidenceRecord(org.bouncycastle.asn1.tsp.EvidenceRecord evidenceRecord, org.bouncycastle.operator.DigestCalculatorProvider digestCalculatorProvider) throws TSPException, ERSException
- Throws:
TSPException
ERSException
-
-
Method Detail
-
getPrimaryRootHash
public byte[] getPrimaryRootHash() throws TSPException, ERSException
Return the timestamp imprint for the initial ArchiveTimeStamp in this evidence record.- Returns:
- initial hash root.
- Throws:
TSPException
ERSException
-
isRelatedTo
public boolean isRelatedTo(ERSEvidenceRecord er)
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
public boolean isContaining(ERSData data, java.util.Date date) throws ERSException
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
public void validatePresent(ERSData data, java.util.Date atDate) throws ERSException
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
public void validatePresent(boolean isDataGroup, byte[] hash, java.util.Date atDate) throws ERSException
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
public X509CertificateHolder getSigningCertificate()
Return the TimeStamp signing certificate if it is present.- Returns:
- the TimeStamp signing certificate.
-
validate
public void validate(SignerInformationVerifier verifier) throws TSPException
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
public byte[] getEncoded() throws java.io.IOException
return the ASN.1 encoded representation of this object.- Throws:
java.io.IOException
-
generateTimeStampRenewalRequest
public TimeStampRequest generateTimeStampRenewalRequest(TimeStampRequestGenerator tspReqGen) throws TSPException, ERSException
- Throws:
TSPException
ERSException
-
generateTimeStampRenewalRequest
public TimeStampRequest generateTimeStampRenewalRequest(TimeStampRequestGenerator tspReqGen, java.math.BigInteger nonce) throws ERSException, TSPException
- Throws:
ERSException
TSPException
-
renewTimeStamp
public ERSEvidenceRecord renewTimeStamp(TimeStampResponse tspResp) throws ERSException, TSPException
- Throws:
ERSException
TSPException
-
generateHashRenewalRequest
public TimeStampRequest generateHashRenewalRequest(org.bouncycastle.operator.DigestCalculator digCalc, ERSData data, TimeStampRequestGenerator tspReqGen) throws ERSException, TSPException, java.io.IOException
- Throws:
ERSException
TSPException
java.io.IOException
-
generateHashRenewalRequest
public TimeStampRequest generateHashRenewalRequest(org.bouncycastle.operator.DigestCalculator digCalc, ERSData data, TimeStampRequestGenerator tspReqGen, java.math.BigInteger nonce) throws ERSException, TSPException, java.io.IOException
- Throws:
ERSException
TSPException
java.io.IOException
-
renewHash
public ERSEvidenceRecord renewHash(org.bouncycastle.operator.DigestCalculator digCalc, ERSData data, TimeStampResponse tspResp) throws ERSException, TSPException
- Throws:
ERSException
TSPException
-
-