CmisSync.CertPolicyHandler.GetCertificateHR C# (CSharp) Méthode

GetCertificateHR() private méthode

Return a human readable string, describing the general Cert properties.
private GetCertificateHR ( X509Certificate x509 ) : string
x509 System.Security.Cryptography.X509Certificates.X509Certificate x509 certificate.
Résultat string
        private string GetCertificateHR(X509Certificate x509) {
            X509Certificate2 x509_2 = new X509Certificate2(x509);
            bool selfsigned = x509_2.IssuerName == x509_2.SubjectName;
            string ret = string.Format(
                "{0}X.509 v{1} Certificate\n",
                selfsigned ? "Self-signed " : string.Empty,
                x509_2.Version);
            ret += string.Format("  Serial Number: {0}\n", x509_2.SerialNumber);
            ret += string.Format("  Issuer Name:   {0}\n", x509.Issuer);
            ret += string.Format("  Subject Name:  {0}\n", x509.Subject);
            ret += string.Format("  Valid From:    {0}\n", x509_2.NotBefore);
            ret += string.Format("  Valid Until:   {0}\n", x509_2.NotAfter);
            ret += string.Format("  Unique Hash:   {0}\n", x509.GetCertHashString());
            return ret;
        }
    }