Bewerken

Delen via


CngKey.Export(CngKeyBlobFormat) Method

Definition

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

Byte[]

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