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
urlstringURL of the time-stamp authority, e.g. "http://timestamp.digicert.com".
userNamestringOptional user for HTTP basic authentication.
passwordstringOptional password for HTTP basic authentication.
httpClientHttpClientOptional HttpClient (proxies, client certificates, ...).
Properties
MaxResponseSize
Maximum accepted response size in bytes (default 1 MB).
public int MaxResponseSize { get; set; }
Property Value
PolicyOid
Optional TSA policy OID.
public string? PolicyOid { get; set; }
Property Value
Url
URL of the time-stamp authority.
public string Url { get; }
Property Value
UserName
User for HTTP basic authentication; null = no authentication.
public string? UserName { get; }
Property Value
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
hashbyte[]hashAlgorithmHashAlgorithmName
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.