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(byte[] hashValue,
java.lang.String hashAlgorithm)
Constructs a timestamp request for the supplied hash value..
|
| Modifier and Type | Method and Description |
|---|---|
byte[] |
encode() |
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(byte[] hashValue,
java.lang.String hashAlgorithm)
hashValue - The hash value. This is the data to be timestamped.hashAlgorithm - The name of the hash algorithm.public void setVersion(int version)
version - The TSP version.public void setPolicyId(java.lang.String policyId)
version - 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.IOExceptionCopyright © 2020. All Rights Reserved.