public class ArchiveTimeStampv3
extends iaik.asn1.structures.AttributeValue
TimeStampToken
) with an unsigned attribute of type AtsHashIndex
.
The message imprint for an archive timestamp contains the content type, content hash, the signer
info fields version, sid, digest algorithm, signed attributes, signature algorithm and signature
as well as the unsigned attribute of type AtsHashIndex.
Before adding an archive timestamp, all data necessary for signature verification shall be
included in the signature. The hashes of this data are included in the AtsHashIndex attribute and
therefore protected by the archive timestamp. Only protected data shall be used for verifying a
signature protected by an archive timestamp.
Use getAtsHashIndex()
to extract the AtsHashIndex object and to further retrieve the
protected data.Modifier and Type | Field and Description |
---|---|
static iaik.asn1.structures.AlgorithmID |
DEFAULTHASHALGORITHM
Default digest algorithm that may be used for generating the TimeStampToken - equal to
AbstractAtsHashIndex.DEFAULTHASHALGORITHM . |
static iaik.asn1.ObjectID |
oid
The attributeType object identifier of the ArchiveTimeStampToken attribute.
|
Constructor and Description |
---|
ArchiveTimeStampv3()
Empty default constructor.
|
ArchiveTimeStampv3(iaik.asn1.ASN1Object timestampToken)
Creates a TimeStampToken from its ASN.1 representation.
|
ArchiveTimeStampv3(iaik.asn1.ASN1Object timestampToken,
byte[] protectedDataImprint)
Creates a TimeStampToken from its ASN.1 representation.
|
Modifier and Type | Method and Description |
---|---|
void |
decode(iaik.asn1.ASN1Object obj)
Decodes the given ASN.1 ArchiveTimeStampToken object
|
boolean |
equals(java.lang.Object obj)
Compares this
ArchiveTimeStampToken to the specified object. |
AbstractAtsHashIndex |
getAtsHashIndex()
Returns the
AtsHashIndex attribute, that shall be included in
every archive timestamp, as unsigned attribute. |
iaik.asn1.ObjectID |
getAttributeType() |
iaik.tsp.TimeStampToken |
getTimeStampToken()
Returns the attribute value of this ArchiveTimeStamp as
TimeStampToken object. |
boolean |
multipleAllowed() |
iaik.asn1.ASN1Object |
toASN1Object()
Returns this ArchiveTimeStampToken as ASN1Object.
|
java.lang.String |
toString() |
void |
verifyTimeStampToken(iaik.x509.X509Certificate tsa_certificate)
Verify this archive timestamp's signature and ensure that the timestamp's imprint corresponds
to the expected imprint.
|
public static final iaik.asn1.ObjectID oid
public static final iaik.asn1.structures.AlgorithmID DEFAULTHASHALGORITHM
AbstractAtsHashIndex.DEFAULTHASHALGORITHM
.public ArchiveTimeStampv3()
public ArchiveTimeStampv3(iaik.asn1.ASN1Object timestampToken) throws iaik.asn1.CodingException
timestampToken
- the TimeStampToken as ASN1Objectiaik.asn1.CodingException
- if the ASN.1 object could not be parsedpublic ArchiveTimeStampv3(iaik.asn1.ASN1Object timestampToken, byte[] protectedDataImprint) throws iaik.asn1.CodingException
verifyTimeStampToken(X509Certificate)
the imprint of the data protected by this
timestamp is set internally by using this constructor. The given protectedDataImprint is the
digest of the protected data using the same digest algorithm as used in the given timestamp
object.timestampToken
- the timestamp object as ASN.1 objectprotectedDataImprint
- the imprint of the data protected by this timestampiaik.asn1.CodingException
- if the ASN.1 object could not be parsedpublic AbstractAtsHashIndex getAtsHashIndex() throws CmsCadesException
AtsHashIndex
attribute, that shall be included in
every archive timestamp, as unsigned attribute.CmsCadesException
- if the AtsHashIndex attribute could not be extracted from the timestamp objectpublic iaik.tsp.TimeStampToken getTimeStampToken() throws CmsCadesException
TimeStampToken
object.CmsCadesException
- if the timestamp token could not be parsedpublic void verifyTimeStampToken(iaik.x509.X509Certificate tsa_certificate) throws CmsCadesException, iaik.tsp.TspVerificationException
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 verifiedpublic void decode(iaik.asn1.ASN1Object obj) throws iaik.asn1.CodingException
obj
- the ArchiveTimeStampToken as ASN1Objectiaik.asn1.CodingException
- if the ASN1Object could not be parsedpublic iaik.asn1.ASN1Object toASN1Object() throws iaik.asn1.CodingException
iaik.asn1.CodingException
- if an de/encoding error occurspublic iaik.asn1.ObjectID getAttributeType()
getAttributeType
in class iaik.asn1.structures.AttributeValue
public java.lang.String toString()
toString
in class iaik.asn1.structures.AttributeValue
public boolean equals(java.lang.Object obj)
ArchiveTimeStampToken
to the specified object.equals
in class java.lang.Object
obj
- the object to compare this ArchiveTimeStampToken
against.true
, if the given object is equal to this
ArchiveTimeStampToken
, false
otherwisepublic boolean multipleAllowed()
multipleAllowed
in class iaik.asn1.structures.AttributeValue