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

public Class ERSEvidenceRecord

extends Object
Class Inheritance
Imports
java.io.IOException, .InputStream, .OutputStream, java.math.BigInteger, java.util.ArrayList, .Date, .List, org.bouncycastle.asn1.ASN1EncodableVector, .ASN1Encoding, .ASN1OctetString, .DERSequence, org.bouncycastle.asn1.cms.CMSObjectIdentifiers, .ContentInfo, .SignedData, org.bouncycastle.asn1.pkcs.PKCSObjectIdentifiers, org.bouncycastle.asn1.tsp.ArchiveTimeStamp, .ArchiveTimeStampChain, .ArchiveTimeStampSequence, .EvidenceRecord, .TSTInfo, org.bouncycastle.asn1.x509.AlgorithmIdentifier, org.bouncycastle.cert.X509CertificateHolder, org.bouncycastle.cms.SignerInformationVerifier, org.bouncycastle.operator.DigestCalculator, .DigestCalculatorProvider, .OperatorCreationException, org.bouncycastle.tsp.TSPException, .TimeStampRequest, .TimeStampRequestGenerator, .TimeStampResponse, org.bouncycastle.util.io.Streams

RFC 4998 Evidence Record.

Field Summary

Modifier and TypeField and Description
private final DigestCalculator
private final DigestCalculatorProvider
private final EvidenceRecord
private final ERSArchiveTimeStamp
private final ERSArchiveTimeStamp
private final byte[]
private final ArchiveTimeStamp

Constructor Summary

AccessConstructor and Description
public
ERSEvidenceRecord(InputStream ersIn, DigestCalculatorProvider digestCalculatorProvider)

public
ERSEvidenceRecord(byte[] evidenceRecord, DigestCalculatorProvider digestCalculatorProvider)

public
ERSEvidenceRecord(EvidenceRecord evidenceRecord, DigestCalculatorProvider digestCalculatorProvider)

Method Summary

Modifier and TypeMethod and Description
private ERSArchiveTimeStampGenerator
private TSTInfo
public TimeStampRequest
public TimeStampRequest
public TimeStampRequest
public TimeStampRequest
pack-priv ArchiveTimeStamp[]
pack-priv DigestCalculatorProvider
public byte[]
getEncoded()

return the ASN.1 encoded representation of this object.

public byte[]

Returns:

initial hash root.
getPrimaryRootHash
()

Return the timestamp imprint for the initial ArchiveTimeStamp in this evidence record.

public X509CertificateHolder

Returns:

the TimeStamp signing certificate.
getSigningCertificate
()

Return the TimeStamp signing certificate if it is present.

public boolean
isContaining(ERSData
the data of interest.
data
,
Date date)

Return true if the hash of data appears in the primary archive time stamp for the current chain.

public boolean

Returns:

true if the primary time stamp has the same value, false otherwise.
isRelatedTo
(ERSEvidenceRecord
the evidence record to be checked.
er
)

Return true if this evidence record is related to the passed in one.

public ERSEvidenceRecord
public ERSEvidenceRecord
public EvidenceRecord
public void
validate(SignerInformationVerifier
signer verifier for the contained time stamp.
verifier
)

Validate the current time stamp associated with this evidence record.

private void
public void
validatePresent(ERSData
the data object/group.
data
,
Date
date at which data is supposed to be valid.
atDate
)

Validate that a particular data object/group is present.

public void
validatePresent(boolean
true if hash represents a data group.
isDataGroup
,
byte[]
expected hash value
hash
,
Date
date at which value is supposed to be valid.
atDate
)

Validate that a particular data object/group is present by hash.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

digCalcback to summary
private final DigestCalculator digCalc
digestCalculatorProviderback to summary
private final DigestCalculatorProvider digestCalculatorProvider
evidenceRecordback to summary
private final EvidenceRecord evidenceRecord
firstArchiveTimeStampback to summary
private final ERSArchiveTimeStamp firstArchiveTimeStamp
lastArchiveTimeStampback to summary
private final ERSArchiveTimeStamp lastArchiveTimeStamp
previousChainsDigestback to summary
private final byte[] previousChainsDigest
primaryArchiveTimeStampback to summary
private final ArchiveTimeStamp primaryArchiveTimeStamp

Constructor Detail

ERSEvidenceRecordback to summary
public ERSEvidenceRecord(InputStream ersIn, DigestCalculatorProvider digestCalculatorProvider) throws TSPException, ERSException, IOException
ERSEvidenceRecordback to summary
public ERSEvidenceRecord(byte[] evidenceRecord, DigestCalculatorProvider digestCalculatorProvider) throws TSPException, ERSException
ERSEvidenceRecordback to summary
public ERSEvidenceRecord(EvidenceRecord evidenceRecord, DigestCalculatorProvider digestCalculatorProvider) throws TSPException, ERSException

Method Detail

buildTspRenewalGeneratorback to summary
private ERSArchiveTimeStampGenerator buildTspRenewalGenerator() throws ERSException
extractTimeStampback to summary
private TSTInfo extractTimeStamp(ContentInfo timeStamp) throws TSPException
generateHashRenewalRequestback to summary
public TimeStampRequest generateHashRenewalRequest(DigestCalculator digCalc, ERSData data, TimeStampRequestGenerator tspReqGen) throws ERSException, TSPException, IOException
generateHashRenewalRequestback to summary
public TimeStampRequest generateHashRenewalRequest(DigestCalculator digCalc, ERSData data, TimeStampRequestGenerator tspReqGen, BigInteger nonce) throws ERSException, TSPException, IOException
generateTimeStampRenewalRequestback to summary
public TimeStampRequest generateTimeStampRenewalRequest(TimeStampRequestGenerator tspReqGen) throws TSPException, ERSException
generateTimeStampRenewalRequestback to summary
public TimeStampRequest generateTimeStampRenewalRequest(TimeStampRequestGenerator tspReqGen, BigInteger nonce) throws ERSException, TSPException
getArchiveTimeStampsback to summary
pack-priv ArchiveTimeStamp[] getArchiveTimeStamps()
getDigestAlgorithmProviderback to summary
pack-priv DigestCalculatorProvider getDigestAlgorithmProvider()
getEncodedback to summary
public byte[] getEncoded() throws IOException

return the ASN.1 encoded representation of this object.

getPrimaryRootHashback to summary
public byte[] getPrimaryRootHash() throws TSPException, ERSException

Return the timestamp imprint for the initial ArchiveTimeStamp in this evidence record.

Returns:byte[]

initial hash root.

getSigningCertificateback to summary
public X509CertificateHolder getSigningCertificate()

Return the TimeStamp signing certificate if it is present.

Returns:X509CertificateHolder

the TimeStamp signing certificate.

isContainingback to summary
public boolean isContaining(ERSData data, Date date) throws ERSException

Return true if the hash of data appears in the primary archive time stamp for the current chain.

Parameters
data:ERSData

the data of interest.

isRelatedToback to summary
public boolean isRelatedTo(ERSEvidenceRecord er)

Return true if this evidence record is related to the passed in one.

Parameters
er:ERSEvidenceRecord

the evidence record to be checked.

Returns:boolean

true if the primary time stamp has the same value, false otherwise.

renewHashback to summary
public ERSEvidenceRecord renewHash(DigestCalculator digCalc, ERSData data, TimeStampResponse tspResp) throws ERSException, TSPException
renewTimeStampback to summary
public ERSEvidenceRecord renewTimeStamp(TimeStampResponse tspResp) throws ERSException, TSPException
toASN1Structureback to summary
public EvidenceRecord toASN1Structure()
validateback to summary
public void validate(SignerInformationVerifier verifier) throws TSPException

Validate the current time stamp associated with this evidence record.

Parameters
verifier:SignerInformationVerifier

signer verifier for the contained time stamp.

Exceptions
TSPException:
in case of validation failure or error.
validateChainsback to summary
private void validateChains(ArchiveTimeStampChain[] chains) throws ERSException, TSPException
validatePresentback to summary
public void validatePresent(ERSData data, Date atDate) throws ERSException

Validate that a particular data object/group is present.

Parameters
data:ERSData

the data object/group.

atDate:Date

date at which data is supposed to be valid.

Exceptions
ERSException:
if the object cannot be found or the record is invalid.
validatePresentback to summary
public void validatePresent(boolean isDataGroup, byte[] hash, Date atDate) throws ERSException

Validate that a particular data object/group is present by hash.

Parameters
isDataGroup:boolean

true if hash represents a data group.

hash:byte[]

expected hash value

atDate:Date

date at which value is supposed to be valid.

Exceptions
ERSException:
if the object cannot be found or the record is invalid.