System.Security.Cryptography.X509Certificates.X509Certificate2.GetNameInfo C# (CSharp) Method

GetNameInfo() public method

public GetNameInfo ( System nameType, bool forIssuer ) : string
nameType System
forIssuer bool
return string
        public string GetNameInfo(System.Security.Cryptography.X509Certificates.X509NameType nameType, bool forIssuer)
        {
            throw null;
        }

Same methods

X509Certificate2::GetNameInfo ( X509NameType nameType, bool forIssuer ) : string

Usage Example

Example #1
1
        public void SubTest()
        {
            X509Certificate2 x509 = new X509Certificate2(@"C:\Users\bxu.CHINA\Desktop\HYD-801\1234\cert\ABCFR_ABCFRALMMACC1.crt");
            //X509Certificate2 x509 = new X509Certificate2(@"..\..\..\ApacheQpidClient\certificates\LiquidCapital\LCMLO_ABCFRALMMACC1.crt");

            byte[] rawdata = x509.RawData;
            Console.WriteLine("Content Type: {0}{1}", X509Certificate2.GetCertContentType(rawdata), Environment.NewLine);
            Console.WriteLine("Friendly Name: {0}{1}", x509.FriendlyName, Environment.NewLine);
            Console.WriteLine("Certificate Verified?: {0}{1}", x509.Verify(), Environment.NewLine);
            Console.WriteLine("Simple Name: {0}{1}", x509.GetNameInfo(X509NameType.SimpleName, true), Environment.NewLine);
            Console.WriteLine("Signature Algorithm: {0}{1}", x509.SignatureAlgorithm.FriendlyName, Environment.NewLine);
            //    Console.WriteLine("Private Key: {0}{1}", x509.PrivateKey.ToXmlString(false), Environment.NewLine);  // cer里面并没有私钥信息
            Console.WriteLine("Public Key: {0}{1}", x509.PublicKey.Key.ToXmlString(false), Environment.NewLine);
            Console.WriteLine("Certificate Archived?: {0}{1}", x509.Archived, Environment.NewLine);
            Console.WriteLine("Length of Raw Data: {0}{1}", x509.RawData.Length, Environment.NewLine);

            Console.WriteLine("SubjectName: {0}{1}", x509.SubjectName, Environment.NewLine);
            Console.WriteLine("Subject: {0}{1}", x509.Subject, Environment.NewLine);

        }
All Usage Examples Of System.Security.Cryptography.X509Certificates.X509Certificate2::GetNameInfo