Esempio n. 1
0
    // Certificate validation callback.
    static bool OnValidateCertificate(Certificate cert)
    {
        Win32Certificate win32Cert = cert as Win32Certificate;

        if (win32Cert != null)
        {
            System.Console.WriteLine("Server certificate details: " + win32Cert.GetCertificateName());
            System.Console.WriteLine("Server certificate issuer details: " + win32Cert.GetIssuerName());
        }

        X509Certificate x509Cert = cert as X509Certificate;

        if (x509Cert != null)
        {
            System.Console.WriteLine("Server certificate details: " + x509Cert.GetCertificateName());
            System.Console.WriteLine("Server certificate issuer details: " + x509Cert.GetIssuerName());
        }

        return(true);
    }