System.Security.Cryptography.X509Certificates.X509Certificate2.Import Method

Populates an System.Security.Cryptography.X509Certificates.X509Certificate2 object with information from a certificate file, a password, and a System.Security.Cryptography.X509Certificates.X509KeyStorageFlags value.

Syntax

[System.MonoTODO("missing KeyStorageFlags support")]
public override void Import (string fileName, string password, X509KeyStorageFlags keyStorageFlags)

Parameters

fileName
The name of a certificate file.
password
The password required to access the X.509 certificate data.
keyStorageFlags
A bitwise combination of the enumeration values that control where and how to import the certificate.

Remarks

This method can be used populate an System.Security.Cryptography.X509Certificates.X509Certificate2 object with information from a certificate file, a password, and an System.Security.Cryptography.X509Certificates.X509KeyStorageFlags value.

Note:

Never hard code a password within your source code. Hard-coded passwords can be retrieved from an assembly using the MSIL Disassembler (Ildasm.exe), a hex editor, or by simply opening up the assembly in a text editor such as Notepad.exe.

Requirements

Namespace: System.Security.Cryptography.X509Certificates
Assembly: System (in System.dll)
Assembly Versions: 2.0.0.0, 4.0.0.0
Since: .NET 2.0