RsaProtectedConfigurationProvider.ImportKey(String, Boolean) Method

Definition

Imports an RSA key into the key container.

public:
 void ImportKey(System::String ^ xmlFileName, bool exportable);
public void ImportKey (string xmlFileName, bool exportable);
member this.ImportKey : string * bool -> unit
Public Sub ImportKey (xmlFileName As String, exportable As Boolean)

Parameters

xmlFileName
String

The file name and path to import the key from.

exportable
Boolean

true to indicate that the key is exportable; otherwise, false.

Exceptions

path is a zero-length string, contains only white space, or contains one or more invalid characters as defined by InvalidPathChars.

path is null.

The specified path, file name, or both exceed the system-defined maximum length.

The specified path is invalid, such as being on an unmapped drive.

An error occurred while opening the file.

path specified a file that is write-only.

-or-

This operation is not supported on the current platform.

-or-

path specified a directory.

-or-

The caller does not have the required permission.

The file specified in path was not found.

path is in an invalid format.

Applies to

See also