Share via


ICertificateVerificationBuilder.VerifyCertificate Method

Definition

Verifies the specified X.509 certificate.

public:
 bool VerifyCertificate(IServiceProvider ^ serviceProvider, System::Security::Cryptography::X509Certificates::X509Certificate2 ^ certificate, System::Security::Cryptography::X509Certificates::X509Chain ^ chain, System::Net::Security::SslPolicyErrors sslPolicyErrors);
public bool VerifyCertificate (IServiceProvider serviceProvider, System.Security.Cryptography.X509Certificates.X509Certificate2 certificate, System.Security.Cryptography.X509Certificates.X509Chain chain, System.Net.Security.SslPolicyErrors sslPolicyErrors);
abstract member VerifyCertificate : IServiceProvider * System.Security.Cryptography.X509Certificates.X509Certificate2 * System.Security.Cryptography.X509Certificates.X509Chain * System.Net.Security.SslPolicyErrors -> bool

Parameters

serviceProvider
IServiceProvider

The IServiceProvider object.

certificate
X509Certificate2

The X.509 certificate to verify.

chain
X509Chain

A certificate chain of X.509 certificates.

sslPolicyErrors
SslPolicyErrors

An enumeration value that specifies the Secure Sockets Layer (SSL) policy errors.

Returns

true if the specified certificate is valid; otherwise, false.

Remarks

This method uses the certificate's chain to verify the certificate and ensure that it is trusted.

Applies to