Export (0) Print
Expand All

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
)

Parameters

contentType
Type: System.Security.Cryptography.X509Certificates.X509ContentType

A supported X509ContentType object.

password
Type: System.String

A string used to protect the byte array.

Return Value

Type: System.Byte[]
X.509 certificate information in a byte array.

ExceptionCondition
CryptographicException

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:

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1
Show:
© 2015 Microsoft