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
configuredMaterialTlsServerCertificateOptionsThe block naming where the bundle, or the chain and its private key, come from.
domainstringThe exact DNS domain the endpoint publishes, in its ASCII form.
cancellationTokenCancellationTokenCancels 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
domainis null, empty, or whitespace.