X509Certificate2Collection.Export 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.
Exports X.509 certificate information based on content type into a byte array.
Overloads
Export(X509ContentType, String) |
Exports X.509 certificate information into a byte array using a password. |
Export(X509ContentType) |
Exports X.509 certificate information into a byte array. |
Export(X509ContentType, String)
Exports X.509 certificate information into a byte array using a password.
public:
cli::array <System::Byte> ^ Export(System::Security::Cryptography::X509Certificates::X509ContentType contentType, System::String ^ password);
public byte[]? Export (System.Security.Cryptography.X509Certificates.X509ContentType contentType, string? password);
public byte[] Export (System.Security.Cryptography.X509Certificates.X509ContentType contentType, string password);
member this.Export : System.Security.Cryptography.X509Certificates.X509ContentType * string -> byte[]
Public Function Export (contentType As X509ContentType, password As String) As Byte()
Parameters
- contentType
- X509ContentType
A supported X509ContentType object.
- password
- String
A string used to protect the byte array.
Returns
X.509 certificate information in a byte array.
Exceptions
The certificate is unreadable, the content is invalid or, in the case of a certificate requiring a password, the private key could not be exported because the password provided was incorrect.
Remarks
This method supports the following X509ContentType types:
Applies to
Export(X509ContentType)
Exports X.509 certificate information into a byte array.
public:
cli::array <System::Byte> ^ Export(System::Security::Cryptography::X509Certificates::X509ContentType contentType);
public byte[]? Export (System.Security.Cryptography.X509Certificates.X509ContentType contentType);
public byte[] Export (System.Security.Cryptography.X509Certificates.X509ContentType contentType);
member this.Export : System.Security.Cryptography.X509Certificates.X509ContentType -> byte[]
Public Function Export (contentType As X509ContentType) As Byte()
Parameters
- contentType
- X509ContentType
A supported X509ContentType object.
Returns
X.509 certificate information in a byte array.
Remarks
This method supports content types that do not require a password.