Table of Contents

Class FailoverTimestampClient

Namespace
MiPdf.Signatures
Assembly
MiPdf.dll

Tries several time-stamp authorities in order and returns the first token obtained.

public sealed class FailoverTimestampClient : ITimestampClient
Inheritance
FailoverTimestampClient
Implements
Inherited Members

Constructors

FailoverTimestampClient(params ITimestampClient[])

Creates a failover client that tries the given clients in this order.

public FailoverTimestampClient(params ITimestampClient[] clients)

Parameters

clients ITimestampClient[]

Exceptions

ArgumentException

No client was given.

FailoverTimestampClient(IEnumerable<ITimestampClient>)

Creates a failover client that tries the given clients in this order.

public FailoverTimestampClient(IEnumerable<ITimestampClient> clients)

Parameters

clients IEnumerable<ITimestampClient>

Exceptions

ArgumentException

No client was given.

Properties

LastErrors

Errors of the failed attempts of the last call (empty if the first TSA succeeded).

public IReadOnlyList<string> LastErrors { get; }

Property Value

IReadOnlyList<string>

Methods

FromUrls(IEnumerable<string>, string?, string?)

Creates a failover client for a list of TSA URLs (optionally with the same basic-auth credentials).

public static FailoverTimestampClient FromUrls(IEnumerable<string> urls, string? userName = null, string? password = null)

Parameters

urls IEnumerable<string>
userName string
password string

Returns

FailoverTimestampClient

GetTimestampToken(byte[], HashAlgorithmName)

Returns the token of the first client that succeeds; network, HTTP and cryptographic errors of a client are recorded in LastErrors and the next client is tried.

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

Parameters

hash byte[]
hashAlgorithm HashAlgorithmName

Returns

byte[]

Exceptions

PdfException

No client returned a token.