HttpClientCertificateManager Class

public abstract class HttpClientCertificateManager

Provides a mechanism for managing client certificates used for authenticating an HttpClient object to a secure server. This abstract class defines the interface for obtaining and managing client certificates.

Inheritance

System.Object
  System.Net.Security.HttpClientCertificateManager

Remarks

When an HttpClient needs to present a client certificate for authentication to a server (e.g., during TLS/SSL handshake with mutual authentication), it uses an instance of a class derived from HttpClientCertificateManager.

Derived classes are responsible for implementing the logic to retrieve and manage client certificates based on specific requirements, such as user consent, certificate selection policies, or certificate acquisition from various sources (e.g., Windows certificate store, hardware security modules).

The HttpClientHandler class has a ClientCertificateManager property that can be set with an instance of a custom HttpClientCertificateManager implementation.

Methods

GetClientCertificateAsync(String, X509CertificateSelectionPolicy)

Asynchronously retrieves a client certificate based on the specified target URI and certificate selection policy.

protected abstract Task<X509Certificate2> GetClientCertificateAsync(String targetUri, X509CertificateSelectionPolicy policy)

GetClientCertificateAsync(String)

Asynchronously retrieves a client certificate based on the specified target URI.

protected abstract Task<X509Certificate2> GetClientCertificateAsync(String targetUri)

Properties

AllowFallbacks

Gets or sets a value indicating whether the manager should allow fallback mechanisms to find a suitable client certificate.

protected virtual Boolean AllowFallbacks { get; set; }

See Also