Class TSAClientBouncyCastle
- Namespace
- iText.Signatures
- Assembly
- itext.sign.dll
Time Stamp Authority Client interface implementation using Bouncy Castle org.bouncycastle.tsp package.
public class TSAClientBouncyCastle : ITSAClient
- Inheritance
-
TSAClientBouncyCastle
- Implements
- Inherited Members
Remarks
Time Stamp Authority Client interface implementation using Bouncy Castle org.bouncycastle.tsp package.
Created by Aiken Sam, 2006-11-15, refactored by Martin Brunecky, 07/15/2007 for ease of subclassing.Constructors
TSAClientBouncyCastle(string)
Creates an instance of a TSAClient that will use BouncyCastle.
public TSAClientBouncyCastle(string url)
Parameters
url
stringString - Time Stamp Authority URL (i.e. "http://tsatest1.digistamp.com/TSA")
TSAClientBouncyCastle(string, string, string)
Creates an instance of a TSAClient that will use BouncyCastle.
public TSAClientBouncyCastle(string url, string username, string password)
Parameters
url
stringString - Time Stamp Authority URL (i.e. "http://tsatest1.digistamp.com/TSA")
username
stringString - user(account) name
password
stringString - password
TSAClientBouncyCastle(string, string, string, int, string)
Constructor.
public TSAClientBouncyCastle(string url, string username, string password, int tokSzEstimate, string digestAlgorithm)
Parameters
url
stringTime Stamp Authority URL (i.e. "http://tsatest1.digistamp.com/TSA")
username
stringuser(account) name, optional
password
stringpassword, optional if used in combination with username, the credentials will be used in basic authentication. Use only in combination with a https url to ensure encryption
tokSzEstimate
intestimated size of received time stamp token (DER encoded)
digestAlgorithm
stringis a hash algorithm
Remarks
Constructor. Note the token size estimate is updated by each call, as the token size is not likely to change (as long as we call the same TSA using the same imprint length).
Fields
DEFAULTHASHALGORITHM
The default value for the hash algorithm
public const string DEFAULTHASHALGORITHM = "SHA-256"
Field Value
DEFAULTTOKENSIZE
The default value for token size estimation.
public const int DEFAULTTOKENSIZE = 10240
Field Value
digestAlgorithm
Hash algorithm
protected string digestAlgorithm
Field Value
tokenSizeEstimate
Estimate of the received time stamp token
protected int tokenSizeEstimate
Field Value
tsaInfo
An interface that allows you to inspect the timestamp info.
protected ITSAInfoBouncyCastle tsaInfo
Field Value
tsaPassword
TSA password
protected string tsaPassword
Field Value
tsaURL
URL of the Time Stamp Authority
protected string tsaURL
Field Value
tsaUsername
TSA Username
protected string tsaUsername
Field Value
Methods
GetMessageDigest()
Gets the MessageDigest to digest the data imprint
public virtual IDigest GetMessageDigest()
Returns
- IDigest
the digest algorithm name
GetTSAReqPolicy()
Gets the TSA request policy that will be used when retrieving timestamp token.
public virtual string GetTSAReqPolicy()
Returns
- string
policy id, or
null
if not set
GetTSAResponse(byte[])
Get timestamp token - communications layer
protected virtual byte[] GetTSAResponse(byte[] requestBytes)
Parameters
requestBytes
byte[]is a byte representation of TSA request
Returns
- byte[]
- byte[] - TSA response, raw bytes (RFC 3161 encoded)
GetTimeStampToken(byte[])
Get RFC 3161 timeStampToken.
public virtual byte[] GetTimeStampToken(byte[] imprint)
Parameters
imprint
byte[]data imprint to be time-stamped
Returns
- byte[]
encoded, TSA signed data of the timeStampToken
Remarks
Get RFC 3161 timeStampToken. Method may return null indicating that timestamp should be skipped.
GetTokenSizeEstimate()
Get the token size estimate.
public virtual int GetTokenSizeEstimate()
Returns
- int
an estimate of the token size
Remarks
Get the token size estimate. Returned value reflects the result of the last succesfull call, padded
SetTSAInfo(ITSAInfoBouncyCastle)
public virtual void SetTSAInfo(ITSAInfoBouncyCastle tsaInfo)
Parameters
tsaInfo
ITSAInfoBouncyCastlethe tsaInfo to set
SetTSAReqPolicy(string)
Sets the TSA request policy that will be used when retrieving timestamp token.
public virtual void SetTSAReqPolicy(string tsaReqPolicy)
Parameters
tsaReqPolicy
stringpolicy id