Windows apps
Collapse the table of content
Expand the table of content
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

CngKey::Export Method (CngKeyBlobFormat^)

 

Exports the key material into a BLOB, in the specified format.

Namespace:   System.Security.Cryptography
Assembly:  System.Core (in System.Core.dll)

public:
array<unsigned char>^ Export(
	CngKeyBlobFormat^ format
)

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.

KeyContainerPermission

for permission to sign data. Demand value: Demand. Associated enumeration: KeyContainerPermissionFlags::Export

.NET Framework
Available since 3.5
Return to top
Show:
© 2017 Microsoft