public class TSAClientBouncyCastle extends Object implements ITSAClient
Created by Aiken Sam, 2006-11-15, refactored by Martin Brunecky, 07/15/2007 for ease of subclassing.
Modifier and Type | Field and Description |
---|---|
static String |
DEFAULTHASHALGORITHM
The default value for the hash algorithm
|
static int |
DEFAULTTOKENSIZE
The default value for the hash algorithm
|
protected String |
digestAlgorithm
Hash algorithm
|
protected int |
tokenSizeEstimate
Estimate of the received time stamp token
|
protected ITSAInfoBouncyCastle |
tsaInfo
An interface that allows you to inspect the timestamp info.
|
protected String |
tsaPassword
TSA password
|
protected String |
tsaURL
URL of the Time Stamp Authority
|
protected String |
tsaUsername
TSA Username
|
Constructor and Description |
---|
TSAClientBouncyCastle(String url)
Creates an instance of a TSAClient that will use BouncyCastle.
|
TSAClientBouncyCastle(String url, String username, String password)
Creates an instance of a TSAClient that will use BouncyCastle.
|
TSAClientBouncyCastle(String url, String username, String password, int tokSzEstimate, String digestAlgorithm)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
MessageDigest |
getMessageDigest()
Gets the MessageDigest to digest the data imprint
|
byte[] |
getTimeStampToken(byte[] imprint)
Get RFC 3161 timeStampToken.
|
int |
getTokenSizeEstimate()
Get the token size estimate.
|
String |
getTSAReqPolicy()
Gets the TSA request policy that will be used when retrieving timestamp token.
|
protected byte[] |
getTSAResponse(byte[] requestBytes)
Get timestamp token - communications layer
|
void |
setTSAInfo(ITSAInfoBouncyCastle tsaInfo) |
void |
setTSAReqPolicy(String tsaReqPolicy)
Sets the TSA request policy that will be used when retrieving timestamp token.
|
public static final String DEFAULTHASHALGORITHM
public static final int DEFAULTTOKENSIZE
protected String tsaURL
protected String tsaUsername
protected String tsaPassword
protected ITSAInfoBouncyCastle tsaInfo
protected int tokenSizeEstimate
protected String digestAlgorithm
public TSAClientBouncyCastle(String url)
url
- String - Time Stamp Authority URL (i.e. "http://tsatest1.digistamp.com/TSA")
public TSAClientBouncyCastle(String url, String username, String password)
url
- String - Time Stamp Authority URL (i.e. "http://tsatest1.digistamp.com/TSA")
username
- String - user(account) name
password
- String - password
public TSAClientBouncyCastle(String url, String username, String password, int tokSzEstimate, String digestAlgorithm)
url
- Time Stamp Authority URL (i.e. "http://tsatest1.digistamp.com/TSA")
username
- user(account) name
password
- password
tokSzEstimate
- estimated size of received time stamp token (DER encoded)
digestAlgorithm
- is a hash algorithm
public void setTSAInfo(ITSAInfoBouncyCastle tsaInfo)
tsaInfo
- the tsaInfo to set
public int getTokenSizeEstimate()
getTokenSizeEstimate
in interface ITSAClient
public String getTSAReqPolicy()
null
if not set
public void setTSAReqPolicy(String tsaReqPolicy)
tsaReqPolicy
- policy id
public MessageDigest getMessageDigest() throws GeneralSecurityException
getMessageDigest
in interface ITSAClient
GeneralSecurityException
- if digestAlgorithm doesn't match any known hash algorithm
public byte[] getTimeStampToken(byte[] imprint) throws IOException, org.bouncycastle.tsp.TSPException
getTimeStampToken
in interface ITSAClient
imprint
- data imprint to be time-stamped
IOException
- if I/O error occurs
org.bouncycastle.tsp.TSPException
- if the TSA response is malformed
protected byte[] getTSAResponse(byte[] requestBytes) throws IOException
requestBytes
- is a byte representation of TSA request
IOException
- if I/O issue occurs
Copyright © 1998–2023 iText Group NV. All rights reserved.