Pkcs12SafeContents.AddCertificate(X509Certificate2) 方法

定义

通过新 Pkcs12CertBag 将证书添加到 SafeContents,并返回新创建的包实例。

public:
 System::Security::Cryptography::Pkcs::Pkcs12CertBag ^ AddCertificate(System::Security::Cryptography::X509Certificates::X509Certificate2 ^ certificate);
public System.Security.Cryptography.Pkcs.Pkcs12CertBag AddCertificate (System.Security.Cryptography.X509Certificates.X509Certificate2 certificate);
member this.AddCertificate : System.Security.Cryptography.X509Certificates.X509Certificate2 -> System.Security.Cryptography.Pkcs.Pkcs12CertBag
Public Function AddCertificate (certificate As X509Certificate2) As Pkcs12CertBag

参数

certificate
X509Certificate2

要添加的证书。

返回

已添加到 SafeContents 的包实例。

例外

certificate 参数为 null

此实例为只读。

certificate 参数状态无效。

适用于

另请参阅