Package org.bouncycastle.tsp.ers
Class ERSArchiveTimeStamp
- java.lang.Object
-
- org.bouncycastle.tsp.ers.ERSArchiveTimeStamp
-
public class ERSArchiveTimeStamp extends java.lang.Object
RFC 4998 ArchiveTimeStamp.
-
-
Constructor Summary
Constructors Constructor Description ERSArchiveTimeStamp(byte[] archiveTimeStamp, org.bouncycastle.operator.DigestCalculatorProvider digCalcProv)
ERSArchiveTimeStamp(org.bouncycastle.asn1.tsp.ArchiveTimeStamp archiveTimeStamp, org.bouncycastle.operator.DigestCalculatorProvider digCalcProv)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ERSArchiveTimeStamp
fromTimeStampToken(TimeStampToken tspToken, org.bouncycastle.operator.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)
org.bouncycastle.asn1.tsp.ArchiveTimeStamp
toASN1Structure()
void
validate(SignerInformationVerifier verifier)
Validate the time stamp associated with this ArchiveTimeStamp.void
validatePresent(boolean isDataGroup, byte[] hash, java.util.Date atDate)
void
validatePresent(ERSData data, java.util.Date atDate)
-
-
-
Constructor Detail
-
ERSArchiveTimeStamp
public ERSArchiveTimeStamp(byte[] archiveTimeStamp, org.bouncycastle.operator.DigestCalculatorProvider digCalcProv) throws TSPException, ERSException
- Throws:
TSPException
ERSException
-
ERSArchiveTimeStamp
public ERSArchiveTimeStamp(org.bouncycastle.asn1.tsp.ArchiveTimeStamp archiveTimeStamp, org.bouncycastle.operator.DigestCalculatorProvider digCalcProv) throws TSPException, ERSException
- Throws:
TSPException
ERSException
-
-
Method Detail
-
getDigestAlgorithmIdentifier
public org.bouncycastle.asn1.x509.AlgorithmIdentifier getDigestAlgorithmIdentifier()
-
validatePresent
public void validatePresent(ERSData data, java.util.Date atDate) throws ERSException
- Throws:
ERSException
-
isContaining
public boolean isContaining(ERSData data, java.util.Date atDate) throws ERSException
- Throws:
ERSException
-
validatePresent
public void validatePresent(boolean isDataGroup, byte[] hash, java.util.Date atDate) throws ERSException
- Throws:
ERSException
-
getTimeStampToken
public TimeStampToken getTimeStampToken()
-
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 time stamp associated with this ArchiveTimeStamp.- Parameters:
verifier
- signer verifier for the contained time stamp.- Throws:
TSPException
- in case of validation failure or error.
-
getGenTime
public java.util.Date getGenTime()
Return the generation time of the time-stamp associated with this archive time stamp.- Returns:
- the time the associated time-stamp was created.
-
getExpiryTime
public java.util.Date getExpiryTime()
Return the not-after date for the time-stamp's signing certificate if it is present.- Returns:
- the issuing TSP server not-after date, or null if not present.
-
toASN1Structure
public org.bouncycastle.asn1.tsp.ArchiveTimeStamp toASN1Structure()
-
getEncoded
public byte[] getEncoded() throws java.io.IOException
return the ASN.1 encoded representation of this object.- Throws:
java.io.IOException
-
fromTimeStampToken
public static ERSArchiveTimeStamp fromTimeStampToken(TimeStampToken tspToken, org.bouncycastle.operator.DigestCalculatorProvider digCalcProv) throws TSPException, ERSException
Build an ArchiveTimeStamp from a regular time stamp token.- Parameters:
tspToken
- the TimeStampToken in the regular time stamp.digCalcProv
- a digest calculator provider for use with the time stamp.- Returns:
- an ERSArchiveTimeStamp containing the time stamp.
- Throws:
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.
-
-