public class TimeStampToken extends Object
Constructor and Description |
---|
TimeStampToken(CMSSignedData signedData) |
TimeStampToken(ContentInfo contentInfo) |
Modifier and Type | Method and Description |
---|---|
Store |
getAttributeCertificates() |
Store |
getCertificates() |
CertStore |
getCertificatesAndCRLs(String type,
String provider) |
Store |
getCRLs() |
byte[] |
getEncoded()
Return a ASN.1 encoded byte stream representing the encoded object.
|
SignerId |
getSID() |
AttributeTable |
getSignedAttributes() |
TimeStampTokenInfo |
getTimeStampInfo() |
AttributeTable |
getUnsignedAttributes() |
boolean |
isSignatureValid(SignerInformationVerifier sigVerifier)
Return true if the signature on time stamp token is valid.
|
CMSSignedData |
toCMSSignedData()
Return the underlying CMSSignedData object.
|
void |
validate(SignerInformationVerifier sigVerifier)
Validate the time stamp token.
|
void |
validate(X509Certificate cert,
String provider)
Deprecated.
|
public TimeStampToken(ContentInfo contentInfo) throws TSPException, IOException
TSPException
IOException
public TimeStampToken(CMSSignedData signedData) throws TSPException, IOException
TSPException
IOException
public TimeStampTokenInfo getTimeStampInfo()
public SignerId getSID()
public AttributeTable getSignedAttributes()
public AttributeTable getUnsignedAttributes()
public CertStore getCertificatesAndCRLs(String type, String provider) throws NoSuchAlgorithmException, NoSuchProviderException, CMSException
public Store getCertificates()
public Store getCRLs()
public Store getAttributeCertificates()
public void validate(X509Certificate cert, String provider) throws TSPException, TSPValidationException, CertificateExpiredException, CertificateNotYetValidException, 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.
public void validate(SignerInformationVerifier sigVerifier) throws TSPException, TSPValidationException
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.
sigVerifier
- the content verifier create the objects required to verify the CMS object in the timestamp.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.public boolean isSignatureValid(SignerInformationVerifier sigVerifier) throws TSPException
Note: this is a much weaker proof of correctness than calling validate().
sigVerifier
- the content verifier create the objects required to verify the CMS object in the timestamp.TSPException
- if the signature cannot be processed or the provider cannot match the algorithm.public CMSSignedData toCMSSignedData()
public byte[] getEncoded() throws IOException
IOException
- if encoding fails.Copyright © 2015. All rights reserved.