Table of Contents

Method AuthenticateAsync

Namespace
MailFathom.Infrastructure.Security.ClientCertificates
Assembly
MailFathom.Infrastructure.dll

AuthenticateAsync(IReadOnlyList<McpClientCertificateTrustProfile>, X509Certificate2?, CancellationToken)

Judges the certificate a connection presented.

public Task<McpClientCertificateAuthenticationResult> AuthenticateAsync(IReadOnlyList<McpClientCertificateTrustProfile> profiles, X509Certificate2? presentedCertificate, CancellationToken cancellationToken)

Parameters

profiles IReadOnlyList<McpClientCertificateTrustProfile>

The trust profiles the deployment configured, in configuration order.

presentedCertificate X509Certificate2

The certificate the TLS connection carried, or null when it carried none.

cancellationToken CancellationToken

Cancels the retrieval of the configured anchor material.

Returns

Task<McpClientCertificateAuthenticationResult>

The profile whose client the certificate identified, or the reason it was refused.

Remarks

The certificate is judged as the connection supplied it. No header is read here or anywhere else: a header naming a certificate is written by whoever sent the request.

Exceptions

ArgumentNullException

Thrown when profiles is null.