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,可能會套用其他格式。

適用於