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. In der Regel lässt der ExportPolicy Schlüssel nicht exportiert werden.

Hinweise

Cryptography Next Generation (CNG) ermöglicht den Export in jedem Format, das der zugrunde liegende Schlüsselspeicheranbieter (Key Storage Provider, KSP) unterstützt. Bei Windows Vista lässt der Standard-KSP (der MicrosoftSoftwareKeyStorageProvider ist) nur den Export privater Schlüssel in den Formaten Pkcs8PrivateBlob, EccPrivateBlob und OpaqueTransportBlob zu. Diese Einschränkung wird vom zugrunde liegenden KSP gesteuert. Wenn Sie einen anderen KSP verwenden, können andere Formate angewendet werden.

Gilt für: