public class ERSEvidenceRecord
extends java.lang.Object
| Constructor and Description |
|---|
ERSEvidenceRecord(byte[] evidenceRecord,
DigestCalculatorProvider digestCalculatorProvider)
Create an evidence record from an encoded EvidenceRecord.
|
ERSEvidenceRecord(org.bouncycastle.asn1.tsp.EvidenceRecord evidenceRecord,
DigestCalculatorProvider digestCalculatorProvider)
Create an evidence record from a parsed EvidenceRecord structure.
|
ERSEvidenceRecord(java.io.InputStream ersIn,
DigestCalculatorProvider digestCalculatorProvider)
Create an evidence record by reading and parsing an encoded EvidenceRecord.
|
| Modifier and Type | Method and Description |
|---|---|
TimeStampRequest |
generateHashRenewalRequest(DigestCalculator digCalc,
ERSData data,
TimeStampRequestGenerator tspReqGen)
Generate a hash renewal request (RFC 4998 hash-tree renewal) for use when the
digest algorithm itself weakens.
|
TimeStampRequest |
generateHashRenewalRequest(DigestCalculator digCalc,
ERSData data,
TimeStampRequestGenerator tspReqGen,
java.math.BigInteger nonce)
Generate a hash renewal request with the passed in nonce.
|
TimeStampRequest |
generateTimeStampRenewalRequest(TimeStampRequestGenerator tspReqGen)
Generate a time-stamp renewal request (RFC 4998 timestamp renewal) over the
existing time-stamps in the current chain, for use when the time-stamp or its
signature algorithm weakens.
|
TimeStampRequest |
generateTimeStampRenewalRequest(TimeStampRequestGenerator tspReqGen,
java.math.BigInteger nonce)
Generate a time-stamp renewal request with the passed in 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(DigestCalculator digCalc,
ERSData data,
TimeStampResponse tspResp)
Apply a hash-tree renewal: append a new ArchiveTimeStampChain built from the
renewal time-stamp (obtained for a
generateHashRenewalRequest(DigestCalculator, ERSData, TimeStampRequestGenerator))
to the ArchiveTimeStampSequence, returning the updated record. |
ERSEvidenceRecord |
renewTimeStamp(TimeStampResponse tspResp)
Apply a time-stamp renewal: append the time-stamp from the passed in response
(obtained for a
generateTimeStampRenewalRequest(TimeStampRequestGenerator))
as a new ArchiveTimeStamp on the current chain, returning the updated record. |
org.bouncycastle.asn1.tsp.EvidenceRecord |
toASN1Structure()
Return the underlying ASN.1 EvidenceRecord structure.
|
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.
|
public ERSEvidenceRecord(java.io.InputStream ersIn,
DigestCalculatorProvider digestCalculatorProvider)
throws TSPException,
ERSException,
java.io.IOException
ersIn - stream to read the encoded evidence record from.digestCalculatorProvider - provider for the digest calculators needed to process the record.TSPExceptionERSExceptionjava.io.IOExceptionpublic ERSEvidenceRecord(byte[] evidenceRecord,
DigestCalculatorProvider digestCalculatorProvider)
throws TSPException,
ERSException
evidenceRecord - the DER encoded evidence record.digestCalculatorProvider - provider for the digest calculators needed to process the record.TSPExceptionERSExceptionpublic ERSEvidenceRecord(org.bouncycastle.asn1.tsp.EvidenceRecord evidenceRecord,
DigestCalculatorProvider digestCalculatorProvider)
throws TSPException,
ERSException
evidenceRecord - the parsed evidence record.digestCalculatorProvider - provider for the digest calculators needed to process the record.ERSException - if the sequence/chain structure is invalid or a renewal is malformed.TSPException - on a time-stamp processing error.public byte[] getPrimaryRootHash()
throws TSPException,
ERSException
TSPExceptionERSExceptionpublic boolean isRelatedTo(ERSEvidenceRecord er)
er - the evidence record to be checked.public boolean isContaining(ERSData data, java.util.Date date) throws ERSException
data - the data of interest.date - date at which the data is supposed to be valid.ERSException - if an error occurs processing the record.public void validatePresent(ERSData data, java.util.Date atDate) throws ERSException
data - the data object/group.atDate - date at which data is supposed to be valid.ERSException - if the object cannot be found or the record is invalid.public void validatePresent(boolean isDataGroup,
byte[] hash,
java.util.Date atDate)
throws ERSException
isDataGroup - true if hash represents a data group.hash - expected hash valueatDate - date at which value is supposed to be valid.ERSException - if the object cannot be found or the record is invalid.public X509CertificateHolder getSigningCertificate()
public void validate(SignerInformationVerifier verifier) throws TSPException
verifier - signer verifier for the contained time stamp.TSPException - in case of validation failure or error.public org.bouncycastle.asn1.tsp.EvidenceRecord toASN1Structure()
public byte[] getEncoded()
throws java.io.IOException
java.io.IOExceptionpublic TimeStampRequest generateTimeStampRenewalRequest(TimeStampRequestGenerator tspReqGen) throws TSPException, ERSException
renewTimeStamp(TimeStampResponse).tspReqGen - generator to use for building the time-stamp request.TSPException - on a time-stamp processing error.ERSException - on an error building the request.public TimeStampRequest generateTimeStampRenewalRequest(TimeStampRequestGenerator tspReqGen, java.math.BigInteger nonce) throws ERSException, TSPException
tspReqGen - generator to use for building the time-stamp request.nonce - nonce to include in the request, or null.ERSException - on an error building the request.TSPException - on a time-stamp processing error.public ERSEvidenceRecord renewTimeStamp(TimeStampResponse tspResp) throws ERSException, TSPException
generateTimeStampRenewalRequest(TimeStampRequestGenerator))
as a new ArchiveTimeStamp on the current chain, returning the updated record.tspResp - the response carrying the renewal time-stamp.ERSException - if the response cannot be processed.TSPException - on a time-stamp processing error.public TimeStampRequest generateHashRenewalRequest(DigestCalculator digCalc, ERSData data, TimeStampRequestGenerator tspReqGen) throws ERSException, TSPException, java.io.IOException
renewHash(DigestCalculator, ERSData, TimeStampResponse).digCalc - digest calculator for the new (stronger) algorithm.data - the data object/group being carried forward; must already be present in the record.tspReqGen - generator to use for building the time-stamp request.ERSException - if the data is not present in the record.TSPException - on a time-stamp processing error.java.io.IOException - on an encoding error.public TimeStampRequest generateHashRenewalRequest(DigestCalculator digCalc, ERSData data, TimeStampRequestGenerator tspReqGen, java.math.BigInteger nonce) throws ERSException, TSPException, java.io.IOException
digCalc - digest calculator for the new (stronger) algorithm.data - the data object/group being carried forward; must already be present in the record.tspReqGen - generator to use for building the time-stamp request.nonce - nonce to include in the request, or null.ERSException - if the data is not present in the record.TSPException - on a time-stamp processing error.java.io.IOException - on an encoding error.public ERSEvidenceRecord renewHash(DigestCalculator digCalc, ERSData data, TimeStampResponse tspResp) throws ERSException, TSPException
generateHashRenewalRequest(DigestCalculator, ERSData, TimeStampRequestGenerator))
to the ArchiveTimeStampSequence, returning the updated record.digCalc - digest calculator for the new algorithm.data - the data object/group being carried forward; must already be present in the record.tspResp - the response carrying the renewal time-stamp.ERSException - if the data is not present or the response cannot be processed.TSPException - on a time-stamp processing error.