Share via


CngKey.Export(CngKeyBlobFormat) 方法

定义

将密钥材料以指定的格式导出到 BLOB 中。

public:
 cli::array <System::Byte> ^ Export(System::Security::Cryptography::CngKeyBlobFormat ^ format);
public byte[] Export (System.Security.Cryptography.CngKeyBlobFormat format);
[System.Security.SecurityCritical]
public byte[] Export (System.Security.Cryptography.CngKeyBlobFormat format);
member this.Export : System.Security.Cryptography.CngKeyBlobFormat -> byte[]
[<System.Security.SecurityCritical>]
member this.Export : System.Security.Cryptography.CngKeyBlobFormat -> byte[]
Public Function Export (format As CngKeyBlobFormat) As Byte()

参数

format
CngKeyBlobFormat

一个指定密钥 BLOB 格式的对象。

返回

Byte[]

一个包含指定格式的密钥材料的 BLOB。

属性

例外

formatnull

所有其他错误。 通常情况下,ExportPolicy 不允许导出密钥。

注解

下一代加密 (CNG) 允许以 KSP) 支持的任何格式导出基础密钥存储提供程序 (。 例如,在 Windows Vista 上,) 的默认 KSP (MicrosoftSoftwareKeyStorageProvider 仅允许导出 、 EccPrivateBlobOpaqueTransportBlob 格式的Pkcs8PrivateBlob私钥。 此限制由基础 KSP 控制。 如果使用其他 KSP,则其他格式可能适用。

适用于