語言

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。

屬性

例外狀況

format 是 null。

其他所有錯誤。 通常,它 ExportPolicy 不允許匯出金鑰。

備註

Cryptography Next Generation(CNG)允許以底層金鑰儲存提供者(KSP)支援的任何格式進行匯出。 例如,在 Windows Vista 上,預設的 KSP(MicrosoftSoftwareKeyStorageProvider)只允許匯出 Pkcs8PrivateBlob、EccPrivateBlob 和 OpaqueTransportBlob 格式的私鑰。 此限制由底層 KSP 控制。 如果你用的是不同的 KSP,可能會有其他格式。

適用於