X509Certificate2Collection.Import X509Certificate2Collection.Import X509Certificate2Collection.Import X509Certificate2Collection.Import Method

Definition

Imports a certificate into a X509Certificate2Collection object.

Overloads

Import(Byte[]) Import(Byte[]) Import(Byte[]) Import(Byte[])

Imports a certificate in the form of a byte array into a X509Certificate2Collection object.

Import(String) Import(String) Import(String) Import(String)

Imports a certificate file into a X509Certificate2Collection object.

Import(Byte[], String, X509KeyStorageFlags) Import(Byte[], String, X509KeyStorageFlags) Import(Byte[], String, X509KeyStorageFlags) Import(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.

Import(String, String, X509KeyStorageFlags) Import(String, String, X509KeyStorageFlags) Import(String, String, X509KeyStorageFlags) Import(String, String, X509KeyStorageFlags)

Imports a certificate file that requires a password into a X509Certificate2Collection object.

Import(Byte[]) Import(Byte[]) Import(Byte[]) Import(Byte[])

Imports a certificate in the form of a byte array into a X509Certificate2Collection object.

public:
 void Import(cli::array <System::Byte> ^ rawData);
public void Import (byte[] rawData);
member this.Import : byte[] -> unit
Public Sub Import (rawData As Byte())
Parameters
rawData
Byte[]

A byte array containing data from an X.509 certificate.

Remarks

This method imports a certificate in the form of a byte array into a X509Certificate2Collection object. This method supports the following X509ContentType types:

Import(String) Import(String) Import(String) Import(String)

Imports a certificate file into a X509Certificate2Collection object.

public:
 void Import(System::String ^ fileName);
public void Import (string fileName);
member this.Import : string -> unit
Public Sub Import (fileName As String)
Parameters
fileName
String String String String

The name of the file containing the certificate information.

Remarks

This method supports the following X509ContentType types:

Import(Byte[], String, X509KeyStorageFlags) Import(Byte[], String, X509KeyStorageFlags) Import(Byte[], String, X509KeyStorageFlags) Import(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.

public:
 void Import(cli::array <System::Byte> ^ rawData, System::String ^ password, System::Security::Cryptography::X509Certificates::X509KeyStorageFlags keyStorageFlags);
public void Import (byte[] rawData, string password, System.Security.Cryptography.X509Certificates.X509KeyStorageFlags keyStorageFlags);
member this.Import : byte[] * string * System.Security.Cryptography.X509Certificates.X509KeyStorageFlags -> unit
Public Sub Import (rawData As Byte(), password As String, keyStorageFlags As X509KeyStorageFlags)
Parameters
rawData
Byte[]

A byte array containing data from an X509Certificate2 object.

password
String String String String

The password required to access the certificate information.

keyStorageFlags
X509KeyStorageFlags X509KeyStorageFlags X509KeyStorageFlags X509KeyStorageFlags

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

Remarks

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:

Import(String, String, X509KeyStorageFlags) Import(String, String, X509KeyStorageFlags) Import(String, String, X509KeyStorageFlags) Import(String, String, X509KeyStorageFlags)

Imports a certificate file that requires a password into a X509Certificate2Collection object.

public:
 void Import(System::String ^ fileName, System::String ^ password, System::Security::Cryptography::X509Certificates::X509KeyStorageFlags keyStorageFlags);
public void Import (string fileName, string password, System.Security.Cryptography.X509Certificates.X509KeyStorageFlags keyStorageFlags);
member this.Import : string * string * System.Security.Cryptography.X509Certificates.X509KeyStorageFlags -> unit
Public Sub Import (fileName As String, password As String, keyStorageFlags As X509KeyStorageFlags)
Parameters
fileName
String String String String

The name of the file containing the certificate information.

password
String String String String

The password required to access the certificate information.

keyStorageFlags
X509KeyStorageFlags X509KeyStorageFlags X509KeyStorageFlags X509KeyStorageFlags

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

Remarks

This method can be used with a PFX/PKCS12 file or other certificate files that require a password. Key containers associated with certificates in the PFX/PKCS12 file can be created and 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.

Note that a PFX/PKCS12 file can contain more than one certificate. This method imports the first certificate associated with the private key or, if no private key is found, the first certificate found.

This method supports the following X509ContentType types:

Applies to