CngKey::Export Method (CngKeyBlobFormat^)
Exports the key material into a BLOB, in the specified format.
Assembly: System.Core (in System.Core.dll)
Parameters
- format
-
Type:
System.Security.Cryptography::CngKeyBlobFormat^
An object that specifies the format of the key BLOB.
Return Value
Type: array<System::Byte>^A BLOB that contains the key material in the specified format.
| Exception | Condition |
|---|---|
| ArgumentNullException | format is null. |
| CryptographicException | All other errors. Typically, the ExportPolicy does not allow the key to be exported. |
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.
for permission to sign data. Demand value: Demand. Associated enumeration: KeyContainerPermissionFlags::Export
Available since 3.5