public class

TSRequest

extends Object
java.lang.Object
   ↳ sun.security.timestamp.TSRequest

Class Overview

This class provides a timestamp request, as defined in RFC 3161. The TimeStampReq ASN.1 type has the following definition:


     TimeStampReq ::= SEQUENCE {
         version           INTEGER { v1(1) },
         messageImprint    MessageImprint
           -- a hash algorithm OID and the hash value of the data to be
           -- time-stamped.
         reqPolicy         TSAPolicyId    OPTIONAL,
         nonce             INTEGER        OPTIONAL,
         certReq           BOOLEAN        DEFAULT FALSE,
         extensions        [0] IMPLICIT Extensions OPTIONAL }

     MessageImprint ::= SEQUENCE {
         hashAlgorithm     AlgorithmIdentifier,
         hashedMessage     OCTET STRING }

     TSAPolicyId ::= OBJECT IDENTIFIER

 

See Also

Summary

Public Constructors
TSRequest(byte[] hashValue, String hashAlgorithm)
Constructs a timestamp request for the supplied hash value..
Public Methods
byte[] encode()
void requestCertificate(boolean returnCertificate)
Request that the TSA include its signing certificate in the response.
void setExtensions(X509Extension[] extensions)
Sets the Time-Stamp Protocol extensions.
void setNonce(BigInteger nonce)
Sets a nonce.
void setPolicyId(String policyId)
Sets an object identifier for the Time-Stamp Protocol policy.
void setVersion(int version)
Sets the Time-Stamp Protocol version.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public TSRequest (byte[] hashValue, String hashAlgorithm)

Constructs a timestamp request for the supplied hash value..

Parameters
hashValue The hash value. This is the data to be timestamped.
hashAlgorithm The name of the hash algorithm.

Public Methods

public byte[] encode ()

Throws
IOException

public void requestCertificate (boolean returnCertificate)

Request that the TSA include its signing certificate in the response.

Parameters
returnCertificate True if the TSA should return its signing certificate. By default it is not returned.

public void setExtensions (X509Extension[] extensions)

Sets the Time-Stamp Protocol extensions.

Parameters
extensions The protocol extensions.

public void setNonce (BigInteger nonce)

Sets a nonce. A nonce is a single-use random number.

Parameters
nonce The nonce value.

public void setPolicyId (String policyId)

Sets an object identifier for the Time-Stamp Protocol policy.

public void setVersion (int version)

Sets the Time-Stamp Protocol version.

Parameters
version The TSP version.