Share via


CngKey.Export(CngKeyBlobFormat) Methode

Definition

Exportiert das Schlüsselmaterial in ein BLOB im angegebenen 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()

Parameter

format
CngKeyBlobFormat

Ein Objekt, das das Format des Schlüssel-BLOB angibt.

Gibt zurück

Byte[]

Ein BLOB, das das Schlüsselmaterial im angegebenen Format enthält.

Attribute

Ausnahmen

format ist null.

Alle anderen Fehler. Normalerweise gestattet die ExportPolicy das Exportieren eines Schlüssels nicht.

Hinweise

Cryptography Next Generation (CNG) ermöglicht den Export in jedem Format, das vom zugrunde liegenden Schlüsselspeicheranbieter (Key Storage Provider, KSP) unterstützt wird. Unter Windows Vista ermöglicht der Standard-KSP (also MicrosoftSoftwareKeyStorageProvider) beispielsweise nur den Export von privaten Schlüsseln in den Pkcs8PrivateBlobFormaten , EccPrivateBlobund OpaqueTransportBlob . Diese Einschränkung wird durch den zugrunde liegenden KSP gesteuert. Wenn Sie einen anderen KSP verwenden, gelten möglicherweise andere Formate.

Gilt für: