DigiStamp.com

dgs.tlkt
Class TsRequest

java.lang.Object
  extended bydgs.tlkt.TsRequest

public final class TsRequest
extends java.lang.Object

Structure of data sent in a time stamp request. The 'TimeStampReq' structure from IETF Time Stamp Protocol RFC3161. Contains

Access/mutators demonstrate the fields supported by DigiStamp.


Constructor Summary
TsRequest()
          TSRequest constructor.
TsRequest(boolean includeCerts)
          Create a request and specify if the certificates should be included with the response.
TsRequest(byte[] encodedTSR)
          Decode a Time Stamp Request.
 
Method Summary
 byte[] asEncoded()
          This method returns a DER encoded time stamp request.
 boolean getCertRequest()
          Will the time stamp include the x.509 certificates?
 byte[] getHashedMessage()
          TSP hashedMessage.
 java.math.BigInteger getNonce()
          TSP nonce.
 java.lang.String getPolicy()
          Time stamp authority policy.
 java.math.BigInteger getVersion()
          TSP version.
 boolean setCertRequest(boolean includeCerts)
          Should the returned time stamp include the x.509 certificates?
 boolean setHashedMessage(byte[] aHashValue)
          TSP hashedMessage.
 boolean setHashedMessage(byte[] aHashValue, java.lang.String objectIdentifier)
          TSP hashedMessage and algorithm identifier.
 boolean setNonce(java.math.BigInteger aNonceValue)
          TSP nonce.
 boolean setPolicy(java.lang.String anOID)
          Time stamp authority policy under which the time stamp is provided.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TsRequest

public TsRequest()
TSRequest constructor.


TsRequest

public TsRequest(boolean includeCerts)
Create a request and specify if the certificates should be included with the response.

Parameters:
includeCerts - - true if should include the certificates in the response

TsRequest

public TsRequest(byte[] encodedTSR)
          throws ExceptionDgsEncode
Decode a Time Stamp Request. This is the reverse operation of the method asEncoded().

Parameters:
encodedTSR -
Throws:
ExceptionDgsEncode
Method Detail

asEncoded

public byte[] asEncoded()
                 throws ExceptionDgsInvalidState,
                        ExceptionDgsEncode
This method returns a DER encoded time stamp request.

Returns:
byte[]
Throws:
ExceptionDgsInvalidState - The request could not be encoded.
ExceptionDgsEncode

getCertRequest

public boolean getCertRequest()
Will the time stamp include the x.509 certificates?


getHashedMessage

public byte[] getHashedMessage()
TSP hashedMessage.
will always be from SHA-1


getNonce

public java.math.BigInteger getNonce()
TSP nonce. The nonce, if included, allows the client to verify the timeliness of the response when no local clock is available. The nonce is a large random number with a high probability that the client generates it only once (e.g., a 64 bit integer). In such a case the same nonce value MUST be included in the response, otherwise the response shall be rejected.


getPolicy

public java.lang.String getPolicy()
Time stamp authority policy. The default policy is "1.3.6.1.4.1.8291.1.1"


getVersion

public java.math.BigInteger getVersion()
TSP version.
For DigiStamp support of current draft we have set this to 0


setCertRequest

public boolean setCertRequest(boolean includeCerts)
Should the returned time stamp include the x.509 certificates? The default is true. See SignedDataA.getCertificates()for additional details.

Parameters:
includeCerts - boolean true indicates to include the x.509 public key certificates
Returns:
boolean

setHashedMessage

public boolean setHashedMessage(byte[] aHashValue)
                         throws ExceptionDgsNotSupported
TSP hashedMessage.
Must always be from SHA-1. This is a convenience method for setting the 20 bytes from a SHA-1 hash. See setHashedMessage(byte[],String)

Parameters:
aHashValue - byte[]
Returns:
boolean
Throws:
ExceptionDgsNotSupported

setHashedMessage

public boolean setHashedMessage(byte[] aHashValue,
                                java.lang.String objectIdentifier)
                         throws ExceptionDgsNotSupported
TSP hashedMessage and algorithm identifier.
Provide the hash value and the algorithm's object identifier. Supported object identifiers:

Parameters:
aHashValue - byte[], String objectIdentifier
Returns:
boolean
Throws:
ExceptionDgsNotSupported

setNonce

public boolean setNonce(java.math.BigInteger aNonceValue)
                 throws ExceptionDgsNotSupported
TSP nonce. The nonce, if included, allows the client to verify the timeliness of the response when no local clock is available. The nonce is a large random number with a high probability that the client generates it only once (e.g., a 64 bit integer). In such a case the same nonce value MUST be included in the response, otherwise the response shall be rejected.

Parameters:
aNonceValue - BigInteger
Returns:
boolean
Throws:
ExceptionDgsNotSupported

setPolicy

public boolean setPolicy(java.lang.String anOID)
                  throws ExceptionDgsNotSupported
Time stamp authority policy under which the time stamp is provided.
The only DigiStamp current policy id is: 1.3.6.1.4.1.8291.1.1
The complete policy can been retrieved at the DigiStamp web site or by contacting support.

Parameters:
anOID - String
Returns:
boolean
Throws:
ExceptionDgsNotSupported

Copyright 2000-2008 DigiStamp, Inc.