CertificateManager.Validate method

Validates the specified X509 certificate according to the provided options.

public static bool Validate(X509Certificate2 cert, bool checkRevocation = false, 
    bool allowWeakAlgorithms = false, bool denySelfSigned = false, 
    OidCollection? expectedPurpose = null, bool strictPurpose = false)
parameter description
cert The X509Certificate2 to validate.
checkRevocation Whether to check certificate revocation status.
allowWeakAlgorithms Whether to allow weak algorithms such as SHA-1 or small key sizes.
denySelfSigned Whether to deny self-signed certificates.
expectedPurpose A collection of expected key purposes (EKU) for the certificate.
strictPurpose If true, the certificate must match the expected purposes exactly.

Return Value

True if the certificate is valid according to the specified options; otherwise, false.

See Also