|
IAIK TSP version 2.32 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object iaik.tsp.TSTInfo
public class TSTInfo
This class implements the TSP ASN.1 type TSTInfo
as it is
specified in RFC 3161.
id-smime-ct-TSTInfo OBJECT IDENTIFIER ::= {id-smime-ct 4} with: id-smime-ct OBJECT IDENTIFIER ::= { id-smime 1 } id-smime OBJECT IDENTIFIER ::= { iso(1) member-body(2) us(840) rsadsi(113549) pkcs(1) pkcs-9(9) 16 }
TSTInfo ::= SEQUENCE { version INTEGER { v1(1) }, policy TSAPolicyID, messageImprint MessageImprint, -- MUST have the same value as the similar field in -- TimeStampReq serialNumber INTEGER, -- Time Stamps 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 }This class handles the ASN.1 structure and the DER encoding and decoding of this structure.
The version
field (currently v1) describes the version of the Timestamp
token.
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 remain valid even after a
possible interruption (e.g. crash) of the service.
Element genTime
is the time at which the timestamp has been created by the TSA. The
ASN.1 GeneralizedTime syntax can include fraction-of-second details. Such
syntax, without the restrictions from RFC 2459 Section 4.1.2.5.2, where
GeneralizedTime is limited to represent time with one second, may used
here. However, when there is no need to have precision better than one
second, then GeneralizedTime with a precision limited to one second SHOULD be
used (as in RFC 2459).
Element 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 has been created by the TSA can be obtained. In
the same way, by subtracting the accuracy
from the GeneralizedTime, a lower
limit of the time at which the timestamp 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 PolicyInformation.
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
timestamp 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 by only looking at the genTime
parameter, whatever the accuracy
of the genTime is.
The nonce
field MUST be present if it was present in the TimeStampReq
. In
such a case it MUST be equal the value provided in the TimeStampReq
structure.
The purpose of the tsa
field is to give a hint for 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)
which is part of the SignerInfo
. Extensions are a generic way to add
additional information in the future.
Extensions are defined in RFC 2459.
Field Summary | |
---|---|
static ObjectID |
ID_CT_TSTINFO
The ObjectID of this object |
Constructor Summary | |
---|---|
TSTInfo()
Default constructor. |
|
TSTInfo(ASN1Object component)
This constructor tries to reconstruct a TSTInfo object from
the given ASN.1 structure. |
|
TSTInfo(ObjectID policy,
MessageImprint message_imprint,
java.math.BigInteger serial_number,
java.util.Date gen_time)
To create a new TSTInfo object a PolicyInformation
object, a MessageImprint object, a serial number and
a generalized time must be provided. |
Method Summary | |
---|---|
void |
decode(ASN1Object component)
This method tries to reconstruct a TSTInfo object from the
given ASN.1 structure. |
void |
decode(byte[] tstInfo)
This method tries to reconstruct a TSTInfo object from an
encoded ASN.1 object. |
void |
decode(java.io.InputStream input_stream)
This method tries to reconstruct a TSTInfo object from the
given InputStream . |
Accuracy |
getAccuracy()
Returns the Accuracy object. |
int |
getBlockSize()
This method has no effect and is only provided to fully implement the iaik.cms.Content interface. |
ObjectID |
getContentType()
Returns the OID of the implemented CMS content type. |
byte[] |
getEncoded()
This method DER encodes the ASN.1 TSTInfo object. |
X509Extensions |
getExtensions()
Returns the X509Extensions object. |
java.util.Date |
getGenTime()
Returns the time string. |
MessageImprint |
getMessageImprint()
Returns the MessageImprint object. |
java.math.BigInteger |
getNonce()
Returns the nonce number. |
boolean |
getOrdering()
Returns the ordering information. |
java.math.BigInteger |
getSerialNumber()
Returns the serial number. |
GeneralName |
getTsa()
Returns the GeneralName object describing the TSA. |
ObjectID |
getTSAPolicyID()
Returns the PolicyInformation object. |
int |
getVersion()
Returns the version of the implemented TSP. |
void |
setAccuracy(Accuracy accuracy)
This method sets a new Accuracy object. |
void |
setBlockSize(int blockSize)
This method has no effect and is only provided to fully implement the iaik.cms.Content interface. |
void |
setExtensions(X509Extensions extensions)
This method sets the X509Extensions . |
void |
setGenTime(java.util.Date gen_time)
This method sets a new generalized time. |
void |
setMessageImprint(MessageImprint message_imprint)
This method sets a new MessageImprint object. |
void |
setNonce(java.math.BigInteger nonce)
This method sets the nonce field. |
void |
setOrdering(boolean ordering)
This method sets ordering to true or false. |
void |
setSerialNumber(java.math.BigInteger serial_number)
This method sets a new serial number. |
void |
setTsa(GeneralName genName)
This method sets a new GeneralName object. |
void |
setTSAPolicyID(ObjectID policy)
This method sets a new PolicyInformation object. |
ASN1Object |
toASN1Object()
Returns the ASN.1 structure of the TSTInfo object. |
java.lang.String |
toString()
This method returns a string representation of this object. |
java.lang.String |
toString(boolean detailed)
This method returns a string representation of this object. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final ObjectID ID_CT_TSTINFO
Constructor Detail |
---|
public TSTInfo()
TSTInfo
object.
public TSTInfo(ObjectID policy, MessageImprint message_imprint, java.math.BigInteger serial_number, java.util.Date gen_time) throws java.lang.NullPointerException
TSTInfo
object a PolicyInformation
object, a MessageImprint
object, a serial number and
a generalized time must be provided.
policy
- Policy under which this TSTInfo object is
constructed.message_imprint
- The hashed message and its algorithm identifier.serial_number
- A unique serial number.gen_time
- The current time.
- Throws:
java.lang.NullPointerException
- Thrown if one of the arguments is null
.
public TSTInfo(ASN1Object component) throws CodingException
TSTInfo
object from
the given ASN.1 structure.
component
- The ASN.1 structure.
CodingException
- Thrown if the given ASN1Object
is not a valid
TSTInfo
ASN.1 object.Method Detail |
---|
public void decode(java.io.InputStream input_stream) throws java.io.IOException, CMSParsingException
TSTInfo
object from the
given InputStream
.
decode
in interface ContentStream
input_stream
- The stream to read from.
java.io.IOException
- Thrown if the stream cannot be read.
CMSParsingException
- Thrown if the given ASN1Object
is not a
TSTInfo
ASN.1 object.public void decode(ASN1Object component) throws CMSParsingException
TSTInfo
object from the
given ASN.1 structure.
decode
in interface Content
component
- The ASN.1 structure.
CMSParsingException
- Thrown if the given ASN.1 Object
is not a
TSTInfo
ASN.1 object.public void decode(byte[] tstInfo) throws CMSParsingException, CodingException
TSTInfo
object from an
encoded ASN.1 object.
tstInfo
- The encoded TSTInfo
object.
CMSParsingException
- Thrown if the given ASN.1 Object
is not a
TSTInfo
.
CodingException
- Thrown if the given argument cannot be decoded.public byte[] getEncoded()
TSTInfo
object.
TSTInfo
object.public ASN1Object toASN1Object()
TSTInfo
object.
toASN1Object
in interface ContentStream
ASN1Object
of the TSTInfo
object.public int getBlockSize()
iaik.cms.Content
interface.
getBlockSize
in interface ContentStream
public void setBlockSize(int blockSize)
iaik.cms.Content
interface.
setBlockSize
in interface ContentStream
blockSize
- This method has no effect.public void setTSAPolicyID(ObjectID policy) throws java.lang.NullPointerException
PolicyInformation
object.
policy
- The PolicyInformation
object.
java.lang.NullPointerException
- Thrown if the given argument is null
.public void setMessageImprint(MessageImprint message_imprint) throws java.lang.NullPointerException
MessageImprint
object.
message_imprint
- The MessageImprint
object.
java.lang.NullPointerException
- Thrown if the given argument is null
.public void setSerialNumber(java.math.BigInteger serial_number) throws java.lang.NullPointerException
serial_number
- The new unique serial number.
java.lang.NullPointerException
- Thrown if the given argument is null
.public void setGenTime(java.util.Date gen_time) throws java.lang.NullPointerException
gen_time
- The generalized time.
java.lang.NullPointerException
- Thrown if the argument is null
.public void setAccuracy(Accuracy accuracy) throws java.lang.NullPointerException
Accuracy
object.
accuracy
- The Accuracy
object.
java.lang.NullPointerException
- Thrown if the provided parameter is null
.public void setOrdering(boolean ordering)
ordering
- true or false.public void setNonce(java.math.BigInteger nonce) throws java.lang.NullPointerException
nonce
- The nonce.
java.lang.NullPointerException
- Thrown if the provided parameter is null
.public void setTsa(GeneralName genName) throws java.lang.IllegalArgumentException
GeneralName
object.
genName
- The GeneralName
object
java.lang.NullPointerException
- Thrown if the provided parameter is null
.
java.lang.IllegalArgumentException
public void setExtensions(X509Extensions extensions) throws java.lang.NullPointerException
X509Extensions
.
extensions
- The X509Extensions
object.
java.lang.NullPointerException
- Thrown if the provided parameter is null
.public ObjectID getContentType()
getContentType
in interface ContentStream
public int getVersion()
public ObjectID getTSAPolicyID()
PolicyInformation
object.
PolicyInformation
object.public MessageImprint getMessageImprint()
MessageImprint
object.
MessageImprint
object.public java.math.BigInteger getSerialNumber()
public java.util.Date getGenTime()
public Accuracy getAccuracy()
Accuracy
object.
Accuracy
object.public boolean getOrdering()
public java.math.BigInteger getNonce()
public GeneralName getTsa()
GeneralName
object describing the TSA.
GeneralName
object.public X509Extensions getExtensions()
X509Extensions
object.
X509Extensions
object.public java.lang.String toString(boolean detailed)
toString
in interface ContentStream
detailed
- True if a detailed message should be displayed.
public java.lang.String toString()
toString
in class java.lang.Object
TSTInfo
object.
|
This Javadoc may contain text parts from text parts from IETF Internet Standard specifications (see copyright note). | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |