Table of Contents

Class TsaClientBouncyCastle

Namespace
iTextSharp.text.pdf
Assembly
iTextSharp.LGPLv2.Core.dll

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. @since 2.1.6

public class TsaClientBouncyCastle : ITsaClient
Inheritance
TsaClientBouncyCastle
Implements
Inherited Members

Constructors

TsaClientBouncyCastle(string)

Creates an instance of a TSAClient that will use BouncyCastle.

public TsaClientBouncyCastle(string url)

Parameters

url string

String - 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 string

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

username string

String - user(account) name

password string

String - password

TsaClientBouncyCastle(string, string, string, int)

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

public TsaClientBouncyCastle(string url, string username, string password, int tokSzEstimate)

Parameters

url string

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

username string

String - user(account) name

password string

String - password

tokSzEstimate int

int - estimated size of received time stamp token (DER encoded)

Fields

TokSzEstimate

Estimate of the received time stamp token

protected int TokSzEstimate

Field Value

int

TsaPassword

TSA password

protected string TsaPassword

Field Value

string

TsaUrl

URL of the Time Stamp Authority

protected string TsaUrl

Field Value

string

TsaUsername

TSA Username

protected string TsaUsername

Field Value

string

Methods

GetTimeStampToken(byte[])

Get timestamp token - Bouncy Castle request encoding / decoding layer

protected byte[] GetTimeStampToken(byte[] imprint)

Parameters

imprint byte[]

Returns

byte[]

GetTimeStampToken(PdfPkcs7, byte[])

Get RFC 3161 timeStampToken. Method may return null indicating that timestamp should be skipped. @throws Exception - TSA request failed @see com.lowagie.text.pdf.TSAClient#getTimeStampToken(com.lowagie.text.pdf.PdfPKCS7, byte[])

public byte[] GetTimeStampToken(PdfPkcs7 caller, byte[] imprint)

Parameters

caller PdfPkcs7

PdfPKCS7 - calling PdfPKCS7 instance (in case caller needs it)

imprint byte[]

byte[] - data imprint to be time-stamped

Returns

byte[]

byte[] - encoded, TSA signed data of the timeStampToken

GetTokenSizeEstimate()

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

public int GetTokenSizeEstimate()

Returns

int

an estimate of the token size

GetTsaResponse(byte[])

Get timestamp token - communications layer

protected virtual byte[] GetTsaResponse(byte[] requestBytes)

Parameters

requestBytes byte[]

Returns

byte[]
  • byte[] - TSA response, raw bytes (RFC 3161 encoded)