public class ContentTimeStamp
extends iaik.asn1.structures.AttributeValue
CAdES (EN 319 122-1 V0.0.6) specifies the ContentTimeStamp attribute to may be
included as a signed attribute in a SignerInfo to prove that the
signed content has already existed before the time/date contained in the
ContentTimeStamp attribute. It is calculated before the content is signed. The value
for the message imprint of the TimeStampToken is calculated over the raw data (value of the
eContent field when the content is included in the SignedData object; raw external
data when the content is not included).
ContentTimestamp::= TimeStampToken
id-aa-ets-contentTimestamp OBJECT IDENTIFIER ::= { iso(1) member-body(2)
us(840) rsadsi(113549) pkcs(1) pkcs-9(9) smime(16) id-aa(2) 20 }
| Modifier and Type | Field and Description |
|---|---|
static iaik.asn1.ObjectID |
oid
The attributeType object identifier of the ContentTimeStamp attribute.
|
| Constructor and Description |
|---|
ContentTimeStamp()
Empty default constructor.
|
ContentTimeStamp(iaik.asn1.ASN1Object obj)
Creates a ContentTimeStamp from its ASN.1 representation.
|
ContentTimeStamp(iaik.asn1.ASN1Object obj,
byte[] messageDigest,
iaik.asn1.structures.AlgorithmID messageDigestAlgorithm)
Creates a ContentTimeStamp from its ASN.1 representation.
|
| Modifier and Type | Method and Description |
|---|---|
void |
decode(iaik.asn1.ASN1Object obj)
Decodes the given ASN.1 ContentTimeStamp object
|
boolean |
equals(java.lang.Object obj)
Compares this
TimeStampToken to the specified object. |
iaik.asn1.ObjectID |
getAttributeType()
Returns the OID identifying the ContentTimeStamp attribute type.
|
iaik.tsp.TimeStampToken |
getTimeStampToken()
Returns the underlying TimeStampToken of this ContentTimeStamp.
|
int |
hashCode()
Returns a hashcode for this object.
|
boolean |
multipleAllowed()
Returns
false since only one AttributeValues of this type is allowed in the SET OF
AttributeValue of an ContentTimeStamp attribute. |
iaik.asn1.ASN1Object |
toASN1Object()
Returns this ContentTimeStamp as ASN1Object.
|
java.lang.String |
toString()
Returns a string representation of this ContentTimeStamp.
|
void |
verifyTimeStampToken(iaik.x509.X509Certificate tsa_certificate)
Verify this timestamp's signature and ensure that the timestamp's imprint corresponds to the
expected imprint.
|
public static final iaik.asn1.ObjectID oid
public ContentTimeStamp()
public ContentTimeStamp(iaik.asn1.ASN1Object obj)
obj - the ContentTimeStamp (TimeStampToken) as ASN1Objectpublic ContentTimeStamp(iaik.asn1.ASN1Object obj,
byte[] messageDigest,
iaik.asn1.structures.AlgorithmID messageDigestAlgorithm)
throws CmsCadesException
obj - the ContentTimeStamp (TimeStampToken) as ASN1ObjectmessageDigest - message digest as specified in the MessageDigest-attribute of the SignerInfo objectmessageDigestAlgorithm - digest algorithm used to calculate the given messageDigestCmsCadesException - if the given messageDigestAlgorithm differs from the digest algorithm used in the
given timestamp tokenpublic boolean equals(java.lang.Object obj)
TimeStampToken to the specified object.equals in class java.lang.Objectobj - the object to compare this TimeStampToken against.true, if the given object is equal to this TimeStampToken,
false otherwisepublic int hashCode()
hashCode in class java.lang.Objectpublic void decode(iaik.asn1.ASN1Object obj)
obj - the ContentTimeStamp as ASN1Objectpublic iaik.asn1.ASN1Object toASN1Object()
public iaik.asn1.ObjectID getAttributeType()
getAttributeType in class iaik.asn1.structures.AttributeValuepublic boolean multipleAllowed()
false since only one AttributeValues of this type is allowed in the SET OF
AttributeValue of an ContentTimeStamp attribute.multipleAllowed in class iaik.asn1.structures.AttributeValuefalse since only one attribute value is allowedpublic java.lang.String toString()
toString in class iaik.asn1.structures.AttributeValuepublic iaik.tsp.TimeStampToken getTimeStampToken()
throws CmsCadesException
CmsCadesExceptionpublic void verifyTimeStampToken(iaik.x509.X509Certificate tsa_certificate)
throws iaik.tsp.TspVerificationException,
CmsCadesException
tsa_certificate - The certificate of the timestamp authorityCmsCadesException - if the imprint is invalid or the timestamp token could not be parsed or no TSA
certificate is availableiaik.tsp.TspVerificationException - if this timestamp's signature could not be verified