RsaProtectedConfigurationProvider.ExportKey(String, Boolean) 方法

定义

从密钥容器导出 RSA 密钥。

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

参数

xmlFileName
String

要将其导出到的文件名和路径。

includePrivateParameters
Boolean

true 指示导出专用参数;否则,为 false.

例外

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

xmlFileNamenull

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

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

打开文件时出错。

xmlFileName 指定为只读的文件。

-或-

当前平台上不支持此作。

-或-

xmlFileName 指定了目录。

-或-

调用方没有所需的权限。

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

xmlFileName 格式无效。

调用方没有所需的权限。

适用于