Edit

Share via


Pkcs12SafeContents.AddCertificate(X509Certificate2) Method

Definition

Adds a certificate to the SafeContents via a new Pkcs12CertBag and returns the newly created bag instance.

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

Parameters

certificate
X509Certificate2

The certificate to add.

Returns

The bag instance which was added to the SafeContents.

Exceptions

The certificate parameter is null.

This instance is read-only.

The certificate parameter is in an invalid state.

Applies to

See also