public class

TSResponse

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

Class Overview

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


     TimeStampResp ::= SEQUENCE {
         status            PKIStatusInfo,
         timeStampToken    TimeStampToken OPTIONAL ]

     PKIStatusInfo ::= SEQUENCE {
         status        PKIStatus,
         statusString  PKIFreeText OPTIONAL,
         failInfo      PKIFailureInfo OPTIONAL }

     PKIStatus ::= INTEGER {
         granted                (0),
           -- when the PKIStatus contains the value zero a TimeStampToken, as
           -- requested, is present.
         grantedWithMods        (1),
           -- when the PKIStatus contains the value one a TimeStampToken,
           -- with modifications, is present.
         rejection              (2),
         waiting                (3),
         revocationWarning      (4),
           -- this message contains a warning that a revocation is
           -- imminent
         revocationNotification (5)
           -- notification that a revocation has occurred }

     PKIFreeText ::= SEQUENCE SIZE (1..MAX) OF UTF8String
           -- text encoded as UTF-8 String (note:  each UTF8String SHOULD
           -- include an RFC 1766 language tag to indicate the language
           -- of the contained text)

     PKIFailureInfo ::= BIT STRING {
         badAlg              (0),
           -- unrecognized or unsupported Algorithm Identifier
         badRequest          (2),
           -- transaction not permitted or supported
         badDataFormat       (5),
           -- the data submitted has the wrong format
         timeNotAvailable    (14),
           -- the TSA's time source is not available
         unacceptedPolicy    (15),
           -- the requested TSA policy is not supported by the TSA
         unacceptedExtension (16),
           -- the requested extension is not supported by the TSA
         addInfoNotAvailable (17)
           -- the additional information requested could not be understood
           -- or is not available
         systemFailure       (25)
           -- the request cannot be handled due to system failure }

     TimeStampToken ::= ContentInfo
         -- contentType is id-signedData
         -- content is SignedData
         -- eContentType within SignedData is id-ct-TSTInfo
         -- eContent within SignedData is TSTInfo

 

See Also

Summary

Constants
int ADD_INFO_NOT_AVAILABLE The additional information requested could not be understood or is not available.
int BAD_ALG Unrecognized or unsupported algorithm identifier.
int BAD_DATA_FORMAT The data submitted has the wrong format.
int BAD_REQUEST The requested transaction is not permitted or supported.
int GRANTED The requested timestamp was granted.
int GRANTED_WITH_MODS The requested timestamp was granted with some modifications.
int REJECTION The requested timestamp was not granted.
int REVOCATION_NOTIFICATION Notification that a certificate revocation has occurred.
int REVOCATION_WARNING A warning that a certificate revocation is imminent.
int SYSTEM_FAILURE The request cannot be handled due to system failure.
int TIME_NOT_AVAILABLE The TSA's time source is not available.
int UNACCEPTED_EXTENSION The requested extension is not supported by the TSA.
int UNACCEPTED_POLICY The requested TSA policy is not supported by the TSA.
int WAITING The requested timestamp has not yet been processed.
Public Methods
byte[] getEncodedToken()
Retrieve the ASN.1 BER encoded timestamp token returned by the TSA.
int getFailureCode()
Retrieve the failure code returned by the TSA.
String getFailureCodeAsText()
int getStatusCode()
Retrieve the status code returned by the TSA.
String getStatusCodeAsText()
String[] getStatusMessages()
Retrieve the status messages returned by the TSA.
PKCS7 getToken()
Retrieve the timestamp token returned by the TSA.
[Expand]
Inherited Methods
From class java.lang.Object

Constants

public static final int ADD_INFO_NOT_AVAILABLE

The additional information requested could not be understood or is not available.

Constant Value: 17 (0x00000011)

public static final int BAD_ALG

Unrecognized or unsupported algorithm identifier.

Constant Value: 0 (0x00000000)

public static final int BAD_DATA_FORMAT

The data submitted has the wrong format.

Constant Value: 5 (0x00000005)

public static final int BAD_REQUEST

The requested transaction is not permitted or supported.

Constant Value: 2 (0x00000002)

public static final int GRANTED

The requested timestamp was granted.

Constant Value: 0 (0x00000000)

public static final int GRANTED_WITH_MODS

The requested timestamp was granted with some modifications.

Constant Value: 1 (0x00000001)

public static final int REJECTION

The requested timestamp was not granted.

Constant Value: 2 (0x00000002)

public static final int REVOCATION_NOTIFICATION

Notification that a certificate revocation has occurred.

Constant Value: 5 (0x00000005)

public static final int REVOCATION_WARNING

A warning that a certificate revocation is imminent.

Constant Value: 4 (0x00000004)

public static final int SYSTEM_FAILURE

The request cannot be handled due to system failure.

Constant Value: 25 (0x00000019)

public static final int TIME_NOT_AVAILABLE

The TSA's time source is not available.

Constant Value: 14 (0x0000000e)

public static final int UNACCEPTED_EXTENSION

The requested extension is not supported by the TSA.

Constant Value: 16 (0x00000010)

public static final int UNACCEPTED_POLICY

The requested TSA policy is not supported by the TSA.

Constant Value: 15 (0x0000000f)

public static final int WAITING

The requested timestamp has not yet been processed.

Constant Value: 3 (0x00000003)

Public Methods

public byte[] getEncodedToken ()

Retrieve the ASN.1 BER encoded timestamp token returned by the TSA.

Returns
  • If null then no token was received.

public int getFailureCode ()

Retrieve the failure code returned by the TSA.

Returns
  • If -1 then no failure code was received.

public String getFailureCodeAsText ()

public int getStatusCode ()

Retrieve the status code returned by the TSA.

public String getStatusCodeAsText ()

public String[] getStatusMessages ()

Retrieve the status messages returned by the TSA.

Returns
  • If null then no status messages were received.

public PKCS7 getToken ()

Retrieve the timestamp token returned by the TSA.

Returns
  • If null then no token was received.