org.bouncycastle.tsp

Class TimeStampToken

public class TimeStampToken extends Object

Constructor Summary
TimeStampToken(CMSSignedData signedData)
Method Summary
CertStoregetCertificatesAndCRLs(String type, String provider)
byte[]getEncoded()
Return a ASN.1 encoded byte stream representing the encoded object.
AttributeTablegetSignedAttributes()
SignerIdgetSID()
TimeStampTokenInfogetTimeStampInfo()
AttributeTablegetUnsignedAttributes()
CMSSignedDatatoCMSSignedData()
Return the underlying CMSSignedData object.
voidvalidate(X509Certificate cert, String provider)
Validate the time stamp token.

Constructor Detail

TimeStampToken

public TimeStampToken(CMSSignedData signedData)

Method Detail

getCertificatesAndCRLs

public CertStore getCertificatesAndCRLs(String type, String provider)

getEncoded

public byte[] getEncoded()
Return a ASN.1 encoded byte stream representing the encoded object.

Throws: IOException if encoding fails.

getSignedAttributes

public AttributeTable getSignedAttributes()

getSID

public SignerId getSID()

getTimeStampInfo

public TimeStampTokenInfo getTimeStampInfo()

getUnsignedAttributes

public AttributeTable getUnsignedAttributes()

toCMSSignedData

public CMSSignedData toCMSSignedData()
Return the underlying CMSSignedData object.

Returns: the underlying CMS structure.

validate

public void validate(X509Certificate cert, String provider)
Validate the time stamp token.

To be valid the token must be signed by the passed in certificate and the certificate must be the one refered to by the SigningCertificate attribute included in the hashed attributes of the token. The certifcate must also have the ExtendedKeyUsageExtension with only KeyPurposeId.id_kp_timeStamping and have been valid at the time the timestamp was created.

A successful call to validate means all the above are true.