Export (0) Print
Expand All

X509Certificate2Collection.Import Method (Byte[], String, X509KeyStorageFlags)

Imports a certificate, in the form of a byte array that requires a password to access the certificate, into a X509Certificate2Collection object.

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

public void Import(
	byte[] rawData,
	string password,
	X509KeyStorageFlags keyStorageFlags


Type: System.Byte[]

A byte array containing data from an X509Certificate2 object.

Type: System.String

The password required to access the certificate information.

Type: System.Security.Cryptography.X509Certificates.X509KeyStorageFlags

A bitwise combination of the enumeration values that control how and where the certificate is imported.

This method can be used with a PFX/PKCS12 binary large object (BLOB) protected by a password. Key containers associated with certificates in the PFX/PKCS12 BLOB can be created and the X509KeyStorageFlags value can be used to control this process. Note that if you do not create a key container, the private key is not persisted.

This method imports a certificate byte array into a collection of certificates. 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
© 2015 Microsoft