CngKey.Export(CngKeyBlobFormat) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Exports the key material into a BLOB, in the specified format.
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()
Parameters
- format
- CngKeyBlobFormat
An object that specifies the format of the key BLOB.
Returns
A BLOB that contains the key material in the specified format.
- Attributes
Exceptions
format
is null
.
All other errors. Typically, the ExportPolicy does not allow the key to be exported.
Remarks
Cryptography Next Generation (CNG) allows export in any format that the underlying key storage provider (KSP) supports. For example, on Windows Vista,the default KSP (which is MicrosoftSoftwareKeyStorageProvider) only allows export of private keys in the Pkcs8PrivateBlob, EccPrivateBlob, and OpaqueTransportBlob formats. This restriction is controlled by the underlying KSP. If you use a different KSP, other formats may apply.
Applies to
意見反應
https://aka.ms/ContentUserFeedback。
即將登場:在 2024 年,我們將逐步淘汰 GitHub 問題作為內容的意見反應機制,並將它取代為新的意見反應系統。 如需詳細資訊,請參閱:提交並檢視相關的意見反應