public class TSTInfo extends java.lang.Object implements ASN1Type
TSTInfo ::= SEQUENCE {
version INTEGER { v1(1) },
policy TSAPolicyId,
messageImprint MessageImprint,
-- MUST have the same value as the similar field in
-- TimeStampReq
serialNumber INTEGER,
-- Time-Stamping users MUST be ready to accommodate integers
-- up to 160 bits.
genTime GeneralizedTime,
accuracy Accuracy OPTIONAL,
ordering BOOLEAN DEFAULT FALSE,
nonce INTEGER OPTIONAL,
-- MUST be present if the similar field was present
-- in TimeStampReq. In that case it MUST have the same value.
tsa [0] GeneralName OPTIONAL,
extensions [1] IMPLICIT Extensions OPTIONAL
}
TSAPolicyId ::= OBJECT IDENTIFIER
The policy field MUST indicate the TSA's policy under which the response was produced. If a similar field was present in the TimeStampReq, then it MUST have the same value, otherwise an error (unacceptedPolicy) MUST be returned. This policy MAY include the following types of information (although this list is certainly not exhaustive):
The messageImprint MUST have the same value as the similar field in TimeStampReq, provided that the size of the hash value matches the expected size of the hash algorithm identified in hashAlgorithm.
The serialNumber field is an integer assigned by the TSA to each TimeStampToken. It MUST be unique for each TimeStampToken issued by a given TSA (i.e., the TSA name and serial number identify a unique TimeStampToken). It should be noticed that the property MUST be preserved even after a possible interruption (e.g., crash) of the service.
genTime is the time at which the time-stamp token has been created by the TSA. It is expressed as UTC time (Coordinated Universal Time) to reduce confusion with the local time zone use. UTC is a time scale, based on the second (SI), as defined and recommended by the CCIR, and maintained by the Bureau International des Poids et Mesures (BIPM). A synonym is "Zulu" time which is used by the civil aviation and represented by the letter "Z" (phonetically "Zulu").
The ASN.1 GeneralizedTime syntax can include fraction-of-second details. Such syntax, without the restrictions from [RFC 3280] Section 4.1.2.5.2, where GeneralizedTime is limited to represent the time with a granularity of one second, may be used here.
GeneralizedTime values MUST include seconds. However, when there is no need to have a precision better than the second, then GeneralizedTime with a precision limited to one second SHOULD be used (as in [RFC 3280]).
accuracy represents the time deviation around the UTC time contained in GeneralizedTime.
By adding the accuracy value to the GeneralizedTime, an upper limit of the time at which the time-stamp token has been created by the TSA can be obtained. In the same way, by subtracting the accuracy to the GeneralizedTime, a lower limit of the time at which the time-stamp token has been created by the TSA can be obtained.
When the accuracy optional field is not present, then the accuracy may be available through other means, e.g., the TSAPolicyId.
If the ordering field is missing, or if the ordering field is present and set to false, then the genTime field only indicates the time at which the time-stamp token has been created by the TSA. In such a case, the ordering of time-stamp tokens issued by the same TSA or different TSAs is only possible when the difference between the genTime of the first time-stamp token and the genTime of the second time-stamp token is greater than the sum of the accuracies of the genTime for each time-stamp token.
If the ordering field is present and set to true, every time-stamp token from the same TSA can always be ordered based on the genTime field, regardless of the genTime accuracy.
The nonce field MUST be present if it was present in the TimeStampReq. In such a case it MUST equal the value provided in the TimeStampReq structure.
The purpose of the tsa field is to give a hint in identifying the name of the TSA. If present, it MUST correspond to one of the subject names included in the certificate that is to be used to verify the token. However, the actual identification of the entity that signed the response will always occur through the use of the certificate identifier (ESSCertID Attribute) inside a SigningCertificate attribute which is part of the signerInfo.
extensions is a generic way to add additional information in the future. Extensions is defined in [RFC 3280].
| Constructor and Description |
|---|
TSTInfo(ASN1Object obj)
Creates a new
TSTInfo object from an ASN1Object. |
TSTInfo(ObjectID policy,
MessageImprint messageImprint,
java.math.BigInteger serialNumber,
java.util.Date genTime)
Creates a new
TSTInfo object with the specified components. |
| Modifier and Type | Method and Description |
|---|---|
void |
addExtension(V3Extension extension)
Adds additional time-stamp token information.
|
void |
decode(ASN1Object obj)
Decodes a
TSTInfo object from an ASN1Object. |
Accuracy |
getAccuracy()
Indicates the accuracy of the time at which the time-stamp was created.
|
V3Extension |
getExtension(ObjectID oid)
Returns a specific piece of addition information about the request,
identified by the extension object identifier.
|
X509Extensions |
getExtensions()
Returns additional time-stamp information.
|
java.util.Date |
getGenTime()
Returns the time at which the time-stamp was created.
|
MessageImprint |
getMessageImprint()
Returns the hash of the datum that the time-stamp applies to.
|
java.math.BigInteger |
getNonce()
Returns the nonce of the time-stamp token information; provides replay
protection.
|
ObjectID |
getPolicy()
Returns the TSA policy under which the time-stamp was issued.
|
java.math.BigInteger |
getSerialNumber()
Returns the serial number of the time-stamp token information.
|
GeneralName |
getTsa()
Provides a hint in identifying the name of the TimeStamp Authority.
|
int |
getVersion()
Returns the version of the TSTInfo structure.
|
boolean |
isOrdering()
Indicates whether this time-stamp can be ordered among other time-stamps
issued by the TimeStamp Authority, without considering accuracy.
|
void |
setAccuracy(Accuracy accuracy)
Sets an indicator for the accuracy of the time at which the time-stamp was
created.
|
void |
setExtensions(X509Extensions extensions)
Sets additional time-stamp token information.
|
void |
setNonce(java.math.BigInteger nonce)
Sets the nonce of the time-stamp token information; provides replay
protection.
|
void |
setOrdering(java.lang.Boolean ordering)
Indicates indicator for whether this time-stamp can be ordered among other
time-stamps issued by the TimeStamp Authority, without considering accuracy.
|
void |
setTsa(GeneralName tsa)
Sets a hint for identifying the name of the TimeStamp Authority.
|
ASN1Object |
toASN1Object()
Encodes this
TSTInfo object as an ASN1Object. |
java.lang.String |
toString()
Creates a text representation of the ASN.1 structure of this
TSTInfo object. |
public TSTInfo(ObjectID policy, MessageImprint messageImprint, java.math.BigInteger serialNumber, java.util.Date genTime)
TSTInfo object with the specified components.
policy - the TSA policy under which the time-stamp was issuedmessageImprint - the hash of the datum that the time-stamp applies toserialNumber - the serial number of the time-stamp token informationgenTime - the time at which the time-stamp was createdjava.lang.IllegalArgumentException - thrown if any of the parameters are nullpublic TSTInfo(ASN1Object obj) throws CodingException
TSTInfo object from an ASN1Object.
The ASN1Object must be an TSTInfo structure.
obj - the ASN.1 representation of an TSTInfo structureCodingException - thrown if an errors occurs while decoding the ANS1Objectjava.lang.IllegalArgumentException - thrown if the parameter is nullpublic int getVersion()
public ObjectID getPolicy()
public MessageImprint getMessageImprint()
public java.math.BigInteger getSerialNumber()
public java.util.Date getGenTime()
public Accuracy getAccuracy()
null if the accuracy component
is not setpublic boolean isOrdering()
false if the ordering component
is not setpublic java.math.BigInteger getNonce()
null if the nonce component is not
setpublic GeneralName getTsa()
null if the tsa component is not setpublic X509Extensions getExtensions()
null if the tsa component is
not setpublic V3Extension getExtension(ObjectID oid) throws X509ExtensionInitException
null
if the requested extension does not exist in the extensions componentX509ExtensionInitException - if there is a problem with the extensionpublic void setAccuracy(Accuracy accuracy)
accuracy - the accuracy componentpublic void setOrdering(java.lang.Boolean ordering)
ordering - the ordering componentpublic void setNonce(java.math.BigInteger nonce)
nonce - the nonce componentpublic void setTsa(GeneralName tsa)
tsa - the tsa componentpublic void setExtensions(X509Extensions extensions)
extensions - the extensions componentpublic void addExtension(V3Extension extension) throws X509ExtensionException
extension - an extensionX509ExtensionExceptionpublic void decode(ASN1Object obj) throws CodingException
TSTInfo object from an ASN1Object.
The ASN1Object must contain an TSTInfo structure.
decode in interface ASN1Typeobj - an ASN.1 representation of a TSTInfo structureCodingException - thrown if an errors occurs while decoding the ANS1Objectjava.lang.IllegalArgumentException - thrown if the parameter is nullpublic ASN1Object toASN1Object() throws CodingException
TSTInfo object as an ASN1Object.
toASN1Object in interface ASN1TypeCodingException - thrown if an error occurs while encoding the 'tsa' or 'extensions'
componentspublic java.lang.String toString()
TSTInfo object.
toString in class java.lang.Object