RsaProtectedConfigurationProvider.ImportKey(String, Boolean) 方法

定义

将 RSA 密钥导入密钥容器。

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)

参数

xmlFileName
String

要从中导入密钥的文件名和路径。

exportable
Boolean

true 指示密钥可导出;否则,为 false.

例外

xmlFileName 是一个零长度字符串,仅包含空格,或包含一个或多个无效字符,由 InvalidPathChars该字符串定义。

xmlFileNamenull

指定的路径、文件名或两者都超过了系统定义的最大长度。

指定的路径无效,例如在未映射的驱动器上。

打开文件时出错。

xmlFileName 指定了一个仅写入的文件。

-或-

当前平台上不支持此作。

-或-

xmlFileName 指定了目录。

-或-

调用方没有所需的权限。

找不到在其中 xmlFileName 指定的文件。

xmlFileName 格式无效。

适用于