public class TSRequest
extends java.lang.Object
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
Timestamper| Constructor and Description |
|---|
TSRequest(java.lang.String tSAPolicyID,
byte[] toBeTimeStamped,
java.security.MessageDigest messageDigest)
Constructs a timestamp request for the supplied data.
|
| Modifier and Type | Method and Description |
|---|---|
byte[] |
encode() |
byte[] |
getHashedMessage() |
void |
requestCertificate(boolean returnCertificate)
Request that the TSA include its signing certificate in the response.
|
void |
setExtensions(java.security.cert.X509Extension[] extensions)
Sets the Time-Stamp Protocol extensions.
|
void |
setNonce(java.math.BigInteger nonce)
Sets a nonce.
|
void |
setPolicyId(java.lang.String policyId)
Sets an object identifier for the Time-Stamp Protocol policy.
|
void |
setVersion(int version)
Sets the Time-Stamp Protocol version.
|
public TSRequest(java.lang.String tSAPolicyID,
byte[] toBeTimeStamped,
java.security.MessageDigest messageDigest)
throws java.security.NoSuchAlgorithmException
toBeTimeStamped - The data to be timestamped.messageDigest - The MessageDigest of the hash algorithm to use.java.security.NoSuchAlgorithmException - if the hash algorithm is not supportedpublic byte[] getHashedMessage()
public void setVersion(int version)
version - The TSP version.public void setPolicyId(java.lang.String policyId)
policyId - The policy object identifier.public void setNonce(java.math.BigInteger nonce)
nonce - The nonce value.public void requestCertificate(boolean returnCertificate)
returnCertificate - True if the TSA should return its signing
certificate. By default, it is not returned.public void setExtensions(java.security.cert.X509Extension[] extensions)
extensions - The protocol extensions.public byte[] encode()
throws java.io.IOException
java.io.IOException