RsaProtectedConfigurationProvider.ImportKey(String, Boolean) 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
将 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该字符串定义。
xmlFileName 是 null。
指定的路径、文件名或两者都超过了系统定义的最大长度。
指定的路径无效,例如在未映射的驱动器上。
打开文件时出错。
xmlFileName 指定了一个仅写入的文件。
-或-
当前平台上不支持此作。
-或-
xmlFileName 指定了目录。
-或-
调用方没有所需的权限。
找不到在其中 xmlFileName 指定的文件。
xmlFileName 格式无效。