Top Description Inners Fields Constructors Methods
org.bouncycastle.tsp

public Class TimeStampToken

extends Object
Class Inheritance
Imports
java.io.ByteArrayOutputStream, .IOException, .OutputStream, java.util.Collection, org.bouncycastle.asn1.ASN1Encoding, .ASN1Primitive, org.bouncycastle.asn1.cms.Attribute, .AttributeTable, .ContentInfo, .IssuerAndSerialNumber, org.bouncycastle.asn1.ess.ESSCertID, .ESSCertIDv2, .SigningCertificate, .SigningCertificateV2, org.bouncycastle.asn1.oiw.OIWObjectIdentifiers, org.bouncycastle.asn1.pkcs.PKCSObjectIdentifiers, org.bouncycastle.asn1.tsp.TSTInfo, org.bouncycastle.asn1.x500.X500Name, org.bouncycastle.asn1.x509.AlgorithmIdentifier, .GeneralName, .IssuerSerial, org.bouncycastle.cert.X509AttributeCertificateHolder, .X509CRLHolder, .X509CertificateHolder, org.bouncycastle.cms.CMSException, .CMSProcessable, .CMSSignedData, .SignerId, .SignerInformation, .SignerInformationVerifier, org.bouncycastle.operator.DigestCalculator, .OperatorCreationException, org.bouncycastle.util.Arrays, .Store

Carrier class for a TimeStampToken.

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class

Field Summary

Modifier and TypeField and Description
pack-priv TimeStampToken.CertID
pack-priv SignerInformation
pack-priv TimeStampTokenInfo
pack-priv CMSSignedData

Constructor Summary

AccessConstructor and Description
public
public

Method Summary

Modifier and TypeMethod and Description
public Store<X509AttributeCertificateHolder>
public Store<X509CertificateHolder>
public Store<X509CRLHolder>
public byte[]
getEncoded()

Return a ASN.1 encoded byte stream representing the encoded object.

public byte[]
getEncoded(String
the ASN.1 encoding format to use ("BER", "DL", or "DER").
encoding
)

return the ASN.1 encoded representation of this object using the specified encoding.

public SignerId
public AttributeTable
private static CMSSignedData
public TimeStampTokenInfo
public AttributeTable
public boolean

Returns:

true if the signature matches, false otherwise.
isSignatureValid
(SignerInformationVerifier
the content verifier create the objects required to verify the CMS object in the timestamp.
sigVerifier
)

Return true if the signature on time stamp token is valid.

public CMSSignedData

Returns:

the underlying CMS structure.
toCMSSignedData
()

Return the underlying CMSSignedData object.

public void
validate(SignerInformationVerifier
the content verifier create the objects required to verify the CMS object in the timestamp.
sigVerifier
)

Validate the time stamp token.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

certIDback to summary
pack-priv TimeStampToken.CertID certID
tsaSignerInfoback to summary
pack-priv SignerInformation tsaSignerInfo
tstInfoback to summary
pack-priv TimeStampTokenInfo tstInfo
tsTokenback to summary
pack-priv CMSSignedData tsToken

Constructor Detail

TimeStampTokenback to summary
public TimeStampToken(ContentInfo contentInfo) throws TSPException, IOException
TimeStampTokenback to summary
public TimeStampToken(CMSSignedData signedData) throws TSPException, IOException

Method Detail

getAttributeCertificatesback to summary
public Store<X509AttributeCertificateHolder> getAttributeCertificates()
getCertificatesback to summary
public Store<X509CertificateHolder> getCertificates()
getCRLsback to summary
public Store<X509CRLHolder> getCRLs()
getEncodedback to summary
public byte[] getEncoded() throws IOException

Return a ASN.1 encoded byte stream representing the encoded object.

Exceptions
IOException:
if encoding fails.
getEncodedback to summary
public byte[] getEncoded(String encoding) throws IOException

return the ASN.1 encoded representation of this object using the specified encoding.

Parameters
encoding:String

the ASN.1 encoding format to use ("BER", "DL", or "DER").

getSIDback to summary
public SignerId getSID()
getSignedAttributesback to summary
public AttributeTable getSignedAttributes()
getSignedDataback to summary
private static CMSSignedData getSignedData(ContentInfo contentInfo) throws TSPException
getTimeStampInfoback to summary
public TimeStampTokenInfo getTimeStampInfo()
getUnsignedAttributesback to summary
public AttributeTable getUnsignedAttributes()
isSignatureValidback to summary
public boolean isSignatureValid(SignerInformationVerifier sigVerifier) throws TSPException

Return true if the signature on time stamp token is valid.

Note

this is a much weaker proof of correctness than calling validate().

Parameters
sigVerifier:SignerInformationVerifier

the content verifier create the objects required to verify the CMS object in the timestamp.

Returns:boolean

true if the signature matches, false otherwise.

Exceptions
TSPException:
if the signature cannot be processed or the provider cannot match the algorithm.
toCMSSignedDataback to summary
public CMSSignedData toCMSSignedData()

Return the underlying CMSSignedData object.

Returns:CMSSignedData

the underlying CMS structure.

validateback to summary
public void validate(SignerInformationVerifier sigVerifier) throws TSPException, TSPValidationException

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 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.

Parameters
sigVerifier:SignerInformationVerifier

the content verifier create the objects required to verify the CMS object in the timestamp.

Exceptions
TSPException:
if an exception occurs in processing the token.
TSPValidationException:
if the certificate or signature fail to be valid.
IllegalArgumentException:
if the sigVerifierProvider has no associated certificate.
org.bouncycastle.tsp back to summary

private Class TimeStampToken.CertID

extends Object
Class Inheritance

Field Summary

Modifier and TypeField and Description
private ESSCertID
private ESSCertIDv2

Constructor Summary

AccessConstructor and Description
pack-priv
CertID(ESSCertID certID)

pack-priv

Method Summary

Modifier and TypeMethod and Description
public byte[]
public AlgorithmIdentifier
public IssuerSerial
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

certIDback to summary
private ESSCertID certID
certIDv2back to summary
private ESSCertIDv2 certIDv2

Constructor Detail

CertIDback to summary
pack-priv CertID(ESSCertID certID)
CertIDback to summary
pack-priv CertID(ESSCertIDv2 certID)

Method Detail

getCertHashback to summary
public byte[] getCertHash()
getHashAlgorithmback to summary
public AlgorithmIdentifier getHashAlgorithm()
getIssuerSerialback to summary
public IssuerSerial getIssuerSerial()