APIdia Launch Partner
Top Description Inners Fields Constructors Methods
sun.security.timestamp

public final Class TSResponse

extends Object
Class Inheritance
Imports
java.io.IOException, sun.security.pkcs.ContentInfo, .PKCS7, sun.security.util.Debug, .DerValue

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

Author
Vincent Ryan
Since
1.5
See Also
Timestamper

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static class

Field Summary

Modifier and TypeField and Description
public static final int
ADD_INFO_NOT_AVAILABLE

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

public static final int
BAD_ALG

Unrecognized or unsupported algorithm identifier.

public static final int
BAD_DATA_FORMAT

The data submitted has the wrong format.

public static final int
BAD_REQUEST

The requested transaction is not permitted or supported.

private static final Debug
private byte[]
private boolean[]
public static final int
GRANTED

The requested timestamp was granted.

public static final int
GRANTED_WITH_MODS

The requested timestamp was granted with some modifications.

public static final int
REJECTION

The requested timestamp was not granted.

public static final int
REVOCATION_NOTIFICATION

Notification that a certificate revocation has occurred.

public static final int
REVOCATION_WARNING

A warning that a certificate revocation is imminent.

private int
private String[]
public static final int
SYSTEM_FAILURE

The request cannot be handled due to system failure.

public static final int
TIME_NOT_AVAILABLE

The TSA's time source is not available.

private TimestampToken
private PKCS7
public static final int
UNACCEPTED_EXTENSION

The requested extension is not supported by the TSA.

public static final int
UNACCEPTED_POLICY

The requested TSA policy is not supported by the TSA.

public static final int
WAITING

The requested timestamp has not yet been processed.

Constructor Summary

AccessConstructor and Description
pack-priv
TSResponse(byte[]
A buffer containing the ASN.1 BER encoded response.
tsReply
)

Constructs an object to store the response to a timestamp request.

Method Summary

Modifier and TypeMethod and Description
public byte[]

Returns:

If null then no token was received.
getEncodedToken
()

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

public String
public boolean[]

Returns:

the failure info, or null if no failure code was received.
getFailureInfo
()

Retrieve the failure info returned by the TSA.

public int
getStatusCode()

Retrieve the status code returned by the TSA.

public String
public String[]

Returns:

If null then no status messages were received.
getStatusMessages
()

Retrieve the status messages returned by the TSA.

public TimestampToken
public PKCS7

Returns:

If null then no token was received.
getToken
()

Retrieve the timestamp token returned by the TSA.

private boolean
isSet(int position)

private void
parse(byte[] tsReply)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

ADD_INFO_NOT_AVAILABLEback to summary
public static final int ADD_INFO_NOT_AVAILABLE

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

BAD_ALGback to summary
public static final int BAD_ALG

Unrecognized or unsupported algorithm identifier.

BAD_DATA_FORMATback to summary
public static final int BAD_DATA_FORMAT

The data submitted has the wrong format.

BAD_REQUESTback to summary
public static final int BAD_REQUEST

The requested transaction is not permitted or supported.

debugback to summary
private static final Debug debug
encodedTsTokenback to summary
private byte[] encodedTsToken
failureInfoback to summary
private boolean[] failureInfo
GRANTEDback to summary
public static final int GRANTED

The requested timestamp was granted.

GRANTED_WITH_MODSback to summary
public static final int GRANTED_WITH_MODS

The requested timestamp was granted with some modifications.

REJECTIONback to summary
public static final int REJECTION

The requested timestamp was not granted.

REVOCATION_NOTIFICATIONback to summary
public static final int REVOCATION_NOTIFICATION

Notification that a certificate revocation has occurred.

REVOCATION_WARNINGback to summary
public static final int REVOCATION_WARNING

A warning that a certificate revocation is imminent.

statusback to summary
private int status
statusStringback to summary
private String[] statusString
SYSTEM_FAILUREback to summary
public static final int SYSTEM_FAILURE

The request cannot be handled due to system failure.

TIME_NOT_AVAILABLEback to summary
public static final int TIME_NOT_AVAILABLE

The TSA's time source is not available.

tstInfoback to summary
private TimestampToken tstInfo
tsTokenback to summary
private PKCS7 tsToken
UNACCEPTED_EXTENSIONback to summary
public static final int UNACCEPTED_EXTENSION

The requested extension is not supported by the TSA.

UNACCEPTED_POLICYback to summary
public static final int UNACCEPTED_POLICY

The requested TSA policy is not supported by the TSA.

WAITINGback to summary
public static final int WAITING

The requested timestamp has not yet been processed.

Constructor Detail

TSResponseback to summary
pack-priv TSResponse(byte[] tsReply) throws IOException

Constructs an object to store the response to a timestamp request.

Parameters
tsReply:byte[]

A buffer containing the ASN.1 BER encoded response.

Exceptions
IOException:
The exception is thrown if a problem is encountered parsing the timestamp response.

Method Detail

getEncodedTokenback to summary
public byte[] getEncodedToken()

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

Returns:byte[]

If null then no token was received.

getFailureCodeAsTextback to summary
public String getFailureCodeAsText()
getFailureInfoback to summary
public boolean[] getFailureInfo()

Retrieve the failure info returned by the TSA.

Returns:boolean[]

the failure info, or null if no failure code was received.

getStatusCodeback to summary
public int getStatusCode()

Retrieve the status code returned by the TSA.

getStatusCodeAsTextback to summary
public String getStatusCodeAsText()
getStatusMessagesback to summary
public String[] getStatusMessages()

Retrieve the status messages returned by the TSA.

Returns:String[]

If null then no status messages were received.

getTimestampTokenback to summary
public TimestampToken getTimestampToken()
getTokenback to summary
public PKCS7 getToken()

Retrieve the timestamp token returned by the TSA.

Returns:PKCS7

If null then no token was received.

isSetback to summary
private boolean isSet(int position)
parseback to summary
private void parse(byte[] tsReply) throws IOException
sun.security.timestamp back to summary

pack-priv final Class TSResponse.TimestampException

extends IOException
Class Inheritance

Field Summary

Modifier and TypeField and Description
private static final long

Constructor Summary

AccessConstructor and Description
pack-priv

Field Detail

serialVersionUIDback to summary
private static final long serialVersionUID

Hides java.io.IOException.serialVersionUID.

Annotations
@Serial

Constructor Detail

TimestampExceptionback to summary
pack-priv TimestampException(String message)