Table of Contents

Method LoadTrustedCertificateAuthorityAsync

Namespace
MailFathom.Infrastructure.Mail
Assembly
MailFathom.Infrastructure.dll

LoadTrustedCertificateAuthorityAsync(TrustAnchorLoader, CancellationToken)

Loads the certificate the account's server must chain to, when it trusts an additional authority.

public Task<TrustAnchorLoadResult?> LoadTrustedCertificateAuthorityAsync(TrustAnchorLoader trustAnchorLoader, CancellationToken cancellationToken)

Parameters

trustAnchorLoader TrustAnchorLoader

The loader that turns configured material into a certificate.

cancellationToken CancellationToken

Cancels the retrieval of the material and of a bundle password.

Returns

Task<TrustAnchorLoadResult>

The load outcome, which the caller owns and must dispose, or null when the account validates against the system trust store alone and no anchor applies.

Remarks

Unusable material is returned as a named failure rather than thrown, so startup can report every account's unusable anchor at once. A caller that is about to connect must treat that failure as fatal for the connection: continuing without the anchor would validate the private server against the system trust store and fail, or worse, invite an operator to look for a way to disable validation.

Exceptions

ArgumentNullException

Thrown when trustAnchorLoader is null.