Edit

Share via


X509Certificate2Collection.ExportPkcs12 Method

Definition

Overloads

ExportPkcs12(PbeParameters, String)

Exports the certificates and private keys in PKCS#12 / PFX format.

ExportPkcs12(Pkcs12ExportPbeParameters, String)

Exports the certificate and private key in PKCS#12 / PFX format.

ExportPkcs12(PbeParameters, String)

Source:
X509Certificate2Collection.cs

Exports the certificates and private keys in PKCS#12 / PFX format.

public:
 cli::array <System::Byte> ^ ExportPkcs12(System::Security::Cryptography::PbeParameters ^ exportParameters, System::String ^ password);
public byte[] ExportPkcs12(System.Security.Cryptography.PbeParameters exportParameters, string? password);
member this.ExportPkcs12 : System.Security.Cryptography.PbeParameters * string -> byte[]
Public Function ExportPkcs12 (exportParameters As PbeParameters, password As String) As Byte()

Parameters

exportParameters
PbeParameters

The algorithm parameters to use for the export.

password
String

The password to use for the export.

Returns

Byte[]

A byte array containing the encoded PKCS#12.

Exceptions

password contains a Unicode 'NULL' character.

exportParameters is null .

The export operation failed.

-or-

exportParameters specifies a HashAlgorithm value that is not supported for the EncryptionAlgorithm value.

-or-

exportParameters contains an invalid encryption algorithm for EncryptionAlgorithm.

Applies to

ExportPkcs12(Pkcs12ExportPbeParameters, String)

Source:
X509Certificate2Collection.cs

Exports the certificate and private key in PKCS#12 / PFX format.

public:
 cli::array <System::Byte> ^ ExportPkcs12(System::Security::Cryptography::X509Certificates::Pkcs12ExportPbeParameters exportParameters, System::String ^ password);
public byte[] ExportPkcs12(System.Security.Cryptography.X509Certificates.Pkcs12ExportPbeParameters exportParameters, string? password);
member this.ExportPkcs12 : System.Security.Cryptography.X509Certificates.Pkcs12ExportPbeParameters * string -> byte[]
Public Function ExportPkcs12 (exportParameters As Pkcs12ExportPbeParameters, password As String) As Byte()

Parameters

exportParameters
Pkcs12ExportPbeParameters

The algorithm parameters to use for the export.

password
String

The password to use for the export.

Returns

Byte[]

A byte array containing the encoded PKCS#12.

Exceptions

password contains a Unicode 'NULL' character.

exportParameters is not a valid value.

The export operation failed.

Applies to