X509Certificate2Collection.Export Method

Definition

Exports X.509 certificate information based on content type into a byte array.

Overloads

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.

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);
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

Byte[]

X.509 certificate information in a byte array.

Remarks

This method supports content types that do not require a password.

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);
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

Byte[]

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