iText 8.0.5 API
iText.Signatures.TSAClientBouncyCastle Class Reference

Time Stamp Authority Client interface implementation using Bouncy Castle org.bouncycastle.tsp package. More...

Inheritance diagram for iText.Signatures.TSAClientBouncyCastle:
iText.Signatures.ITSAClient

Public Member Functions

  TSAClientBouncyCastle (String url)
  Creates an instance of a TSAClient that will use BouncyCastle. More...
 
  TSAClientBouncyCastle (String url, String username, String password)
  Creates an instance of a TSAClient that will use BouncyCastle. More...
 
  TSAClientBouncyCastle (String url, String username, String password, int tokSzEstimate, String digestAlgorithm)
  Constructor. More...
 
virtual void  SetTSAInfo (ITSAInfoBouncyCastle tsaInfo)
 
Parameters
tsaInfo the tsaInfo to set

 
virtual int  GetTokenSizeEstimate ()
  Get the token size estimate. More...
 
virtual String  GetTSAReqPolicy ()
  Gets the TSA request policy that will be used when retrieving timestamp token. More...
 
virtual void  SetTSAReqPolicy (String tsaReqPolicy)
  Sets the TSA request policy that will be used when retrieving timestamp token. More...
 
virtual IDigest  GetMessageDigest ()
  Gets the MessageDigest to digest the data imprint More...
 
virtual byte[]  GetTimeStampToken (byte[] imprint)
  Get RFC 3161 timeStampToken. More...
 

Static Public Attributes

const String  DEFAULTHASHALGORITHM = "SHA-256"
  The default value for the hash algorithm More...
 
const int  DEFAULTTOKENSIZE = 10240
  The default value for token size estimation. More...
 

Package Functions

virtual byte[]  GetTSAResponse (byte[] requestBytes)
  Get timestamp token - communications layer More...
 

Package Attributes

String  tsaURL
  URL of the Time Stamp Authority More...
 
String  tsaUsername
  TSA Username More...
 
String  tsaPassword
  TSA password More...
 
ITSAInfoBouncyCastle  tsaInfo
  An interface that allows you to inspect the timestamp info. More...
 
int  tokenSizeEstimate = DEFAULTTOKENSIZE
  Estimate of the received time stamp token More...
 
String  digestAlgorithm = DEFAULTHASHALGORITHM
  Hash algorithm More...
 

Detailed Description

Time Stamp Authority Client interface implementation using Bouncy Castle org.bouncycastle.tsp package.

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.

Constructor & Destructor Documentation

◆ TSAClientBouncyCastle() [1/3]

iText.Signatures.TSAClientBouncyCastle.TSAClientBouncyCastle ( String  url )
inline

Creates an instance of a TSAClient that will use BouncyCastle.

Parameters
url String - Time Stamp Authority URL (i.e. "http://tsatest1.digistamp.com/TSA")

◆ TSAClientBouncyCastle() [2/3]

iText.Signatures.TSAClientBouncyCastle.TSAClientBouncyCastle ( String  url,
String  username,
String  password 
)
inline

Creates an instance of a TSAClient that will use BouncyCastle.

Parameters
url String - Time Stamp Authority URL (i.e. "http://tsatest1.digistamp.com/TSA")
username String - user(account) name
password String - password

◆ TSAClientBouncyCastle() [3/3]

iText.Signatures.TSAClientBouncyCastle.TSAClientBouncyCastle ( String  url,
String  username,
String  password,
int  tokSzEstimate,
String  digestAlgorithm 
)
inline

Constructor.

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).

Parameters
url Time Stamp Authority URL (i.e. "http://tsatest1.digistamp.com/TSA")
username user(account) name, optional
password password, 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 estimated size of received time stamp token (DER encoded)
digestAlgorithm is a hash algorithm

Member Function Documentation

◆ GetMessageDigest()

virtual IDigest iText.Signatures.TSAClientBouncyCastle.GetMessageDigest ( )
inlinevirtual

Gets the MessageDigest to digest the data imprint

Returns
the digest algorithm name

Implements iText.Signatures.ITSAClient.

◆ GetTimeStampToken()

virtual byte [] iText.Signatures.TSAClientBouncyCastle.GetTimeStampToken ( byte[]  imprint )
inlinevirtual

Get RFC 3161 timeStampToken.

Get RFC 3161 timeStampToken. Method may return null indicating that timestamp should be skipped.

Parameters
imprint data imprint to be time-stamped
Returns
encoded, TSA signed data of the timeStampToken

Implements iText.Signatures.ITSAClient.

◆ GetTokenSizeEstimate()

virtual int iText.Signatures.TSAClientBouncyCastle.GetTokenSizeEstimate ( )
inlinevirtual

Get the token size estimate.

Get the token size estimate. Returned value reflects the result of the last succesfull call, padded

Returns
an estimate of the token size

Implements iText.Signatures.ITSAClient.

◆ GetTSAReqPolicy()

virtual String iText.Signatures.TSAClientBouncyCastle.GetTSAReqPolicy ( )
inlinevirtual

Gets the TSA request policy that will be used when retrieving timestamp token.

Returns
policy id, or null if not set

◆ GetTSAResponse()

virtual byte [] iText.Signatures.TSAClientBouncyCastle.GetTSAResponse ( byte[]  requestBytes )
inlinepackagevirtual

Get timestamp token - communications layer

Parameters
requestBytes is a byte representation of TSA request
Returns
- byte[] - TSA response, raw bytes (RFC 3161 encoded)

◆ SetTSAReqPolicy()

virtual void iText.Signatures.TSAClientBouncyCastle.SetTSAReqPolicy ( String  tsaReqPolicy )
inlinevirtual

Sets the TSA request policy that will be used when retrieving timestamp token.

Parameters
tsaReqPolicy policy id

Member Data Documentation

◆ DEFAULTHASHALGORITHM

const String iText.Signatures.TSAClientBouncyCastle.DEFAULTHASHALGORITHM = "SHA-256"
static

The default value for the hash algorithm

◆ DEFAULTTOKENSIZE

const int iText.Signatures.TSAClientBouncyCastle.DEFAULTTOKENSIZE = 10240
static

The default value for token size estimation.

◆ digestAlgorithm

String iText.Signatures.TSAClientBouncyCastle.digestAlgorithm = DEFAULTHASHALGORITHM
package

Hash algorithm

◆ tokenSizeEstimate

int iText.Signatures.TSAClientBouncyCastle.tokenSizeEstimate = DEFAULTTOKENSIZE
package

Estimate of the received time stamp token

◆ tsaInfo

ITSAInfoBouncyCastle iText.Signatures.TSAClientBouncyCastle.tsaInfo
package

An interface that allows you to inspect the timestamp info.

◆ tsaPassword

String iText.Signatures.TSAClientBouncyCastle.tsaPassword
package

TSA password

◆ tsaURL

String iText.Signatures.TSAClientBouncyCastle.tsaURL
package

URL of the Time Stamp Authority

◆ tsaUsername

String iText.Signatures.TSAClientBouncyCastle.tsaUsername
package

TSA Username