21.346. Class CertificateValidator

Namespace: ArmoniK.Core.Utils
Assembly: ArmoniK.Core.Utils.dll

Provides utilities for validating SSL/TLS certificates.

public static class CertificateValidator

21.346.1. Inheritance

objectCertificateValidator

21.346.2. Inherited Members

object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.MemberwiseClone(), object.ReferenceEquals(object?, object?), object.ToString()

21.346.3. Methods

21.346.3.1. CreateCallback(string, bool, ILogger)

Creates a certificate validation callback from a Certificate Authority (CA) file.

public static RemoteCertificateValidationCallback CreateCallback(string caFilePath, bool allowHostMismatch, ILogger logger)

21.346.3.1.1. Parameters

caFilePath string

The file path to the CA certificate.

allowHostMismatch bool

Do not consider host mismatch between request and certificate as an error

logger ILogger

The logger to use for logging validation details.

21.346.3.1.2. Returns

RemoteCertificateValidationCallback

A delegate that performs SSL/TLS certificate validation.

21.346.3.1.3. Exceptions

FileNotFoundException

Thrown if the specified CA certificate file is not found.

21.346.3.2. ValidationCallback(ILogger, X509Certificate2Collection, bool)

Creates a callback function to validate SSL/TLS certificates during a secure connection.

public static RemoteCertificateValidationCallback ValidationCallback(ILogger logger, X509Certificate2Collection authority, bool allowHostMismatch)

21.346.3.2.1. Parameters

logger ILogger

The logger to use for logging validation details.

authority X509Certificate2Collection

The root certificate authority to trust during validation.

allowHostMismatch bool

Ignore HostMismatch error

21.346.3.2.2. Returns

RemoteCertificateValidationCallback

A delegate that performs SSL/TLS certificate validation.