org.bouncycastle.tsp
public class TimeStampToken extends java.lang.Object
Constructor and Description |
---|
TimeStampToken(org.bouncycastle.cms.CMSSignedData signedData) |
TimeStampToken(org.bouncycastle.asn1.cms.ContentInfo contentInfo) |
Modifier and Type | Method and Description |
---|---|
java.security.cert.CertStore |
getCertificatesAndCRLs(java.lang.String type,
java.lang.String provider) |
byte[] |
getEncoded()
Return a ASN.1 encoded byte stream representing the encoded object.
|
org.bouncycastle.cms.SignerId |
getSID() |
org.bouncycastle.asn1.cms.AttributeTable |
getSignedAttributes() |
TimeStampTokenInfo |
getTimeStampInfo() |
org.bouncycastle.asn1.cms.AttributeTable |
getUnsignedAttributes() |
org.bouncycastle.cms.CMSSignedData |
toCMSSignedData()
Return the underlying CMSSignedData object.
|
void |
validate(java.security.cert.X509Certificate cert,
java.lang.String provider)
Validate the time stamp token.
|
public TimeStampToken(org.bouncycastle.asn1.cms.ContentInfo contentInfo) throws TSPException, java.io.IOException
TSPException
java.io.IOException
public TimeStampToken(org.bouncycastle.cms.CMSSignedData signedData) throws TSPException, java.io.IOException
TSPException
java.io.IOException
public TimeStampTokenInfo getTimeStampInfo()
public org.bouncycastle.cms.SignerId getSID()
public org.bouncycastle.asn1.cms.AttributeTable getSignedAttributes()
public org.bouncycastle.asn1.cms.AttributeTable getUnsignedAttributes()
public java.security.cert.CertStore getCertificatesAndCRLs(java.lang.String type, java.lang.String provider) throws java.security.NoSuchAlgorithmException, java.security.NoSuchProviderException, org.bouncycastle.cms.CMSException
java.security.NoSuchAlgorithmException
java.security.NoSuchProviderException
org.bouncycastle.cms.CMSException
public void validate(java.security.cert.X509Certificate cert, java.lang.String provider) throws TSPException, TSPValidationException, java.security.cert.CertificateExpiredException, java.security.cert.CertificateNotYetValidException, java.security.NoSuchProviderException
To be valid the token must be signed by the passed in certificate and the certificate must be the one referred to by the SigningCertificate attribute included in the hashed attributes of the token. The certificate 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.
TSPException
TSPValidationException
java.security.cert.CertificateExpiredException
java.security.cert.CertificateNotYetValidException
java.security.NoSuchProviderException
public org.bouncycastle.cms.CMSSignedData toCMSSignedData()
public byte[] getEncoded() throws java.io.IOException
java.io.IOException
- if encoding fails.