X509Certificate.ExportPkcs12 Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
| ExportPkcs12(PbeParameters, String) |
Exports the certificate and private key in PKCS#12 / PFX format. |
| ExportPkcs12(Pkcs12ExportPbeParameters, String) |
Exports the certificate and private key in PKCS#12 / PFX format. |
ExportPkcs12(PbeParameters, String)
- Source:
- X509Certificate.cs
Exports the certificate and private key 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
A byte array containing the encoded PKCS#12.
Exceptions
password contains a Unicode 'NULL' character.
exportParameters is null .
The current instance is disposed.
-or-
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:
- X509Certificate.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
A byte array containing the encoded PKCS#12.
Exceptions
password contains a Unicode 'NULL' character.
exportParameters is not a valid value.