Table of Contents

Class HttpTimestampClient

Namespace
MiPdf.Signatures
Assembly
MiPdf.dll

RFC 3161 time-stamp client over HTTP(S).

public sealed class HttpTimestampClient : ITimestampClient
Inheritance
HttpTimestampClient
Implements
Inherited Members

Constructors

HttpTimestampClient(string, string?, string?, HttpClient?)

public HttpTimestampClient(string url, string? userName = null, string? password = null, HttpClient? httpClient = null)

Parameters

url string

URL of the time-stamp authority, e.g. "http://timestamp.digicert.com".

userName string

Optional user for HTTP basic authentication.

password string

Optional password for HTTP basic authentication.

httpClient HttpClient

Optional HttpClient (proxies, client certificates, ...).

Properties

MaxResponseSize

Maximum accepted response size in bytes (default 1 MB).

public int MaxResponseSize { get; set; }

Property Value

int

PolicyOid

Optional TSA policy OID.

public string? PolicyOid { get; set; }

Property Value

string

Url

URL of the time-stamp authority.

public string Url { get; }

Property Value

string

UserName

User for HTTP basic authentication; null = no authentication.

public string? UserName { get; }

Property Value

string

Methods

GetTimestampToken(byte[], HashAlgorithmName)

Sends an RFC 3161 time-stamp request with a random nonce (HTTP POST) and returns the DER-encoded token after checking that the response matches the request.

public byte[] GetTimestampToken(byte[] hash, HashAlgorithmName hashAlgorithm)

Parameters

hash byte[]
hashAlgorithm HashAlgorithmName

Returns

byte[]

Exceptions

PdfException

The TSA returned an HTTP error or a response larger than MaxResponseSize.

CryptographicException

The response is invalid or does not match the request.