Table of Contents

Method LoadAsync

Namespace
MailFathom.Infrastructure.Certificates
Assembly
MailFathom.Infrastructure.dll

LoadAsync(TlsServerCertificateOptions?, string, CancellationToken)

Loads and validates the identity an endpoint presents for one domain.

public Task<TlsServerCertificateLoadResult> LoadAsync(TlsServerCertificateOptions? configuredMaterial, string domain, CancellationToken cancellationToken)

Parameters

configuredMaterial TlsServerCertificateOptions

The block naming where the bundle, or the chain and its private key, come from.

domain string

The exact DNS domain the endpoint publishes, in its ASCII form.

cancellationToken CancellationToken

Cancels the material retrieval and every password retrieval it needs.

Returns

Task<TlsServerCertificateLoadResult>

The loaded identity, whose ownership passes to the caller, or a named failure.

Remarks

The material is erased before this returns, whether loading succeeded or not, so the identity outlives the bytes it was parsed from. A returned identity has already been proven usable for domain: nothing downstream re-checks its validity period, its names, or its key usage.

Exceptions

ArgumentException

Thrown when domain is null, empty, or whitespace.