Export Method (X509ContentType, String)
Collapse the table of content
Expand the table of content

X509Certificate2Collection.Export Method (X509ContentType, String)


Exports X.509 certificate information into a byte array using a password.

Namespace:   System.Security.Cryptography.X509Certificates
Assembly:  System (in System.dll)

public byte[] Export(
	X509ContentType contentType,
	string password


Type: System.Security.Cryptography.X509Certificates.X509ContentType

A supported X509ContentType object.

Type: System.String

A string used to protect the byte array.

Return Value

Type: System.Byte[]

X.509 certificate information in a byte array.

Exception Condition

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.

This method supports the following X509ContentType types:

Universal Windows Platform
Available since 10
.NET Framework
Available since 2.0
Return to top
© 2016 Microsoft