CngKey.Export(CngKeyBlobFormat) 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
以指定格式将密钥材料导出到 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。
- 属性
例外
format 是 null。
所有其他错误。 通常, ExportPolicy 不允许导出密钥。
注解
加密下一代(CNG)允许以基础密钥存储提供程序(KSP)支持的任何格式导出。 例如,在 Windows Vista 上,默认 KSP(即 MicrosoftSoftwareKeyStorageProvider)仅允许导出 Pkcs8PrivateBlob、EccPrivateBlob 和 OpaqueTransportBlob 格式的私钥。 此限制由基础 KSP 控制。 如果使用其他 KSP,则可能会应用其他格式。