O'Reilly logo

C# in a Nutshell by Peter Drayton, Ted Neward, Ben Albahari

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Name

ICertificatePolicy

Synopsis

This interface validates the certificates that web servers present to your applications. If you create a web request that uses the https protocol, the .NET Framework uses the default certificate policy to validate the server’s certificate.

You can implement this interface to create your own custom certificate policy. Unlike authentication modules, only one certificate policy may be active at a time. To set this, create an instance of your implementation and assign it to ServicePointManager.CertificatePolicy.

public interface ICertificatePolicy {
// Public Instance Methods
   public method bool CheckValidationResult(
        ServicePoint srvPoint, 
        System.Security.Cryptography.X509Certificates.X509Certificate certificate, 
        WebRequest request, int certificateProblem);  
}

Returned By

ServicePointManager.CertificatePolicy

Passed To

ServicePointManager.CertificatePolicy

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required