Top Description Fields Constructors Methods
sun.security.timestamp

public Class TimestampToken

extends Object
Class Inheritance
Imports
java.io.IOException, java.math.BigInteger, java.util.Date, sun.security.util.DerValue, .ObjectIdentifier, sun.security.x509.AlgorithmId

This class provides the timestamp token info resulting from a successful timestamp request, as defined in RFC 3161. The timestampTokenInfo ASN.1 type has the following definition:

    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 }

    Accuracy ::= SEQUENCE {
        seconds        INTEGER           OPTIONAL,
        millis     [0] INTEGER  (1..999) OPTIONAL,
        micros     [1] INTEGER  (1..999) OPTIONAL  }

Author
Vincent Ryan
Since
1.5
See Also
Timestamper

Field Summary

Modifier and TypeField and Description
private Date
private AlgorithmId
private byte[]
private BigInteger
private ObjectIdentifier
private BigInteger
private int

Constructor Summary

AccessConstructor and Description
public
TimestampToken(byte[]
A buffer containing the ASN.1 BER encoding of the TSTInfo element defined in RFC 3161.
timestampTokenInfo
)

Constructs an object to store a timestamp token.

Method Summary

Modifier and TypeMethod and Description
public Date

Returns:

The date and time when the timestamp was generated.
getDate
()

Extract the date and time from the timestamp token.

public AlgorithmId
public byte[]
public BigInteger
public String
public BigInteger
private void
parse(byte[] timestampTokenInfo)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

genTimeback to summary
private Date genTime
hashAlgorithmback to summary
private AlgorithmId hashAlgorithm
hashedMessageback to summary
private byte[] hashedMessage
nonceback to summary
private BigInteger nonce
policyback to summary
private ObjectIdentifier policy
serialNumberback to summary
private BigInteger serialNumber
versionback to summary
private int version

Constructor Detail

TimestampTokenback to summary
public TimestampToken(byte[] timestampTokenInfo) throws IOException

Constructs an object to store a timestamp token.

Parameters
timestampTokenInfo:byte[]

A buffer containing the ASN.1 BER encoding of the TSTInfo element defined in RFC 3161.

Method Detail

getDateback to summary
public Date getDate()

Extract the date and time from the timestamp token.

Returns:Date

The date and time when the timestamp was generated.

getHashAlgorithmback to summary
public AlgorithmId getHashAlgorithm()
getHashedMessageback to summary
public byte[] getHashedMessage()
getNonceback to summary
public BigInteger getNonce()
getPolicyIDback to summary
public String getPolicyID()
getSerialNumberback to summary
public BigInteger getSerialNumber()
parseback to summary
private void parse(byte[] timestampTokenInfo) throws IOException