public class ERSArchiveTimeStamp
extends java.lang.Object
| Constructor and Description |
|---|
ERSArchiveTimeStamp(org.bouncycastle.asn1.tsp.ArchiveTimeStamp archiveTimeStamp,
DigestCalculatorProvider digCalcProv)
Create an archive time-stamp from a parsed ArchiveTimeStamp structure.
|
ERSArchiveTimeStamp(byte[] archiveTimeStamp,
DigestCalculatorProvider digCalcProv)
Create an archive time-stamp from an encoded ArchiveTimeStamp.
|
| Modifier and Type | Method and Description |
|---|---|
static ERSArchiveTimeStamp |
fromTimeStampToken(TimeStampToken tspToken,
DigestCalculatorProvider digCalcProv)
Build an ArchiveTimeStamp from a regular time stamp token.
|
org.bouncycastle.asn1.x509.AlgorithmIdentifier |
getDigestAlgorithmIdentifier() |
byte[] |
getEncoded()
return the ASN.1 encoded representation of this object.
|
java.util.Date |
getExpiryTime()
Return the not-after date for the time-stamp's signing certificate
if it is present.
|
java.util.Date |
getGenTime()
Return the generation time of the time-stamp associated with
this archive time stamp.
|
X509CertificateHolder |
getSigningCertificate()
Return the TimeStamp signing certificate if it is present.
|
TimeStampToken |
getTimeStampToken() |
boolean |
isContaining(ERSData data,
java.util.Date atDate)
Return true if the passed in data object/group is present in this archive
time-stamp at the given date.
|
org.bouncycastle.asn1.tsp.ArchiveTimeStamp |
toASN1Structure()
Return the underlying ASN.1 ArchiveTimeStamp structure.
|
void |
validate(SignerInformationVerifier verifier)
Validate the time stamp associated with this ArchiveTimeStamp.
|
void |
validatePresent(boolean isDataGroup,
byte[] hash,
java.util.Date atDate)
Validate that data with the given hash is present in this archive time-stamp
at the given date.
|
void |
validatePresent(ERSData data,
java.util.Date atDate)
Validate that the passed in data object/group is present in this archive
time-stamp at the given date - that its hash appears in the reduced hash
tree and the recovered root hash matches the time-stamp imprint.
|
public ERSArchiveTimeStamp(byte[] archiveTimeStamp,
DigestCalculatorProvider digCalcProv)
throws TSPException,
ERSException
archiveTimeStamp - the DER encoded ArchiveTimeStamp.digCalcProv - provider for the digest calculator matching the structure's digest algorithm.TSPExceptionERSExceptionpublic ERSArchiveTimeStamp(org.bouncycastle.asn1.tsp.ArchiveTimeStamp archiveTimeStamp,
DigestCalculatorProvider digCalcProv)
throws TSPException,
ERSException
archiveTimeStamp - the ArchiveTimeStamp to wrap.digCalcProv - provider for the digest calculator matching the structure's digest algorithm.TSPExceptionERSExceptionpublic org.bouncycastle.asn1.x509.AlgorithmIdentifier getDigestAlgorithmIdentifier()
public void validatePresent(ERSData data, java.util.Date atDate) throws ERSException
data - the data object or data group to check for.atDate - date the data is expected to be valid at; the time-stamp must not be in the future relative to it.ERSException - if the data is not present, or the time-stamp generation time is after atDate.public boolean isContaining(ERSData data, java.util.Date atDate) throws ERSException
validatePresent(ERSData, Date)
but returning a boolean rather than throwing on absence.data - the data object or data group to check for.atDate - date the data is expected to be valid at.ArchiveTimeStampValidationException - if the time-stamp generation time is after atDate.ERSExceptionpublic void validatePresent(boolean isDataGroup,
byte[] hash,
java.util.Date atDate)
throws ERSException
isDataGroup - true if the hash represents a data group rather than a single object.hash - the (pre-computed) hash of the data object/group to check for.atDate - date the data is expected to be valid at.ERSException - if the hash is not present, or the time-stamp generation time is after atDate.public TimeStampToken getTimeStampToken()
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 java.util.Date getGenTime()
public java.util.Date getExpiryTime()
public org.bouncycastle.asn1.tsp.ArchiveTimeStamp toASN1Structure()
public byte[] getEncoded()
throws java.io.IOException
java.io.IOExceptionpublic static ERSArchiveTimeStamp fromTimeStampToken(TimeStampToken tspToken, DigestCalculatorProvider digCalcProv) throws TSPException, ERSException
tspToken - the TimeStampToken in the regular time stamp.digCalcProv - a digest calculator provider for use with the time stamp.TSPException - on a failure to parse the time stamp token data.ERSException - on a failure to convert the time stamp token to an archive time stamp.