其他分享
首页 > 其他分享> > X509Certificate 类

X509Certificate 类

作者:互联网

 

地址:https://docs.microsoft.com/zh-cn/dotnet/api/system.security.cryptography.x509certificates.x509certificate?view=netframework-4.8

标题:X509Certificate 类

 

.NET Framework 4.8版,文档。

提供帮助你使用 X.509 v.3 证书的方法。

继承
Object  X509Certificate
派生
System.Security.Cryptography.X509Certificates.X509Certificate2
属性
ComVisibleAttribute SerializableAttribute
实现
IDisposable  IDeserializationCallback  ISerializable  
using System;
using System.Security.Cryptography.X509Certificates;


public class X509
{

    public static void Main()
    {

        // The path to the certificate.
        string Certificate = "Certificate.cer";

        // Load the certificate into an X509Certificate object.
        X509Certificate cert = new X509Certificate(Certificate);

        // Get the value.
        string resultsTrue = cert.ToString(true);

        // Display the value to the console.
        Console.WriteLine(resultsTrue);

        // Get the value.
        string resultsFalse = cert.ToString(false);

        // Display the value to the console.
        Console.WriteLine(resultsFalse);

    }

}

 

只有此类支持的唯一证书格式。

在大多数情况下,应该改用 X509Certificate2 类。

 

标签:string,Certificate,System,value,cert,X509Certificate
来源: https://www.cnblogs.com/Tpf386/p/11996787.html