Share via


CngKey.Create Methode

Definition

Erstellt ein CngKey-Objekt, das einen neuen Schlüssel darstellt.

Überlädt

Create(CngAlgorithm)

Erstellt ein CngKey-Objekt, das mit dem angegebenen Algorithmus verwendet werden kann.

Create(CngAlgorithm, String)

Erstellt ein benanntes CngKey-Objekt, das den angegebenen Algorithmus bereitstellt.

Create(CngAlgorithm, String, CngKeyCreationParameters)

Erstellt ein benanntes CngKey-Objekt, das den angegebenen Algorithmus bereitstellt und die angegebenen Schlüsselerstellungsparameter verwendet.

Create(CngAlgorithm)

Quelle:
Cng.NotSupported.cs
Quelle:
Cng.NotSupported.cs
Quelle:
Cng.NotSupported.cs

Erstellt ein CngKey-Objekt, das mit dem angegebenen Algorithmus verwendet werden kann.

public:
 static System::Security::Cryptography::CngKey ^ Create(System::Security::Cryptography::CngAlgorithm ^ algorithm);
public static System.Security.Cryptography.CngKey Create (System.Security.Cryptography.CngAlgorithm algorithm);
[System.Runtime.Versioning.SupportedOSPlatform("windows")]
public static System.Security.Cryptography.CngKey Create (System.Security.Cryptography.CngAlgorithm algorithm);
static member Create : System.Security.Cryptography.CngAlgorithm -> System.Security.Cryptography.CngKey
[<System.Runtime.Versioning.SupportedOSPlatform("windows")>]
static member Create : System.Security.Cryptography.CngAlgorithm -> System.Security.Cryptography.CngKey
Public Shared Function Create (algorithm As CngAlgorithm) As CngKey

Parameter

algorithm
CngAlgorithm

Der Algorithmus, mit dem der Schlüssel verwendet wird.

Gibt zurück

Ein flüchtiger Schlüssel.

Attribute

Ausnahmen

algorithm ist null.

Cryptography Next Generation (CNG) wird auf diesem System nicht unterstützt.

Alle anderen Fehler.

Hinweise

Durch diese Überladung wird ein Schlüssel ohne Namen erstellt, was bedeutet, dass der Schlüssel kurzlebig ist (d. h. er wird nicht beibehalten). Außerdem wird ein Standardobjekt CngKeyCreationParameters erstellt, das einen Standardparameter CngProvider und andere erweiterte Parameter für den Schlüssel angibt.

Gilt für:

Create(CngAlgorithm, String)

Quelle:
Cng.NotSupported.cs
Quelle:
Cng.NotSupported.cs
Quelle:
Cng.NotSupported.cs

Erstellt ein benanntes CngKey-Objekt, das den angegebenen Algorithmus bereitstellt.

public:
 static System::Security::Cryptography::CngKey ^ Create(System::Security::Cryptography::CngAlgorithm ^ algorithm, System::String ^ keyName);
public static System.Security.Cryptography.CngKey Create (System.Security.Cryptography.CngAlgorithm algorithm, string keyName);
public static System.Security.Cryptography.CngKey Create (System.Security.Cryptography.CngAlgorithm algorithm, string? keyName);
[System.Runtime.Versioning.SupportedOSPlatform("windows")]
public static System.Security.Cryptography.CngKey Create (System.Security.Cryptography.CngAlgorithm algorithm, string? keyName);
static member Create : System.Security.Cryptography.CngAlgorithm * string -> System.Security.Cryptography.CngKey
[<System.Runtime.Versioning.SupportedOSPlatform("windows")>]
static member Create : System.Security.Cryptography.CngAlgorithm * string -> System.Security.Cryptography.CngKey
Public Shared Function Create (algorithm As CngAlgorithm, keyName As String) As CngKey

Parameter

algorithm
CngAlgorithm

Der Algorithmus, mit dem der Schlüssel verwendet wird.

keyName
String

Der Name des Schlüssels. Wenn kein Name bereitgestellt wird, wird der Schlüssel nicht beibehalten.

Gibt zurück

Ein beibehaltener oder flüchtiger Schlüssel, der den angegebenen Algorithmus bereitstellt.

Attribute

Ausnahmen

algorithm ist null.

Cryptography Next Generation (CNG) wird auf diesem System nicht unterstützt.

Alle anderen Fehler.

Hinweise

Wenn keyName angegeben, wird durch diese Überladung ein dauerhafter Schlüssel erstellt. Wenn keyName nicht angegeben wird, ist der Schlüssel kurzlebig. Diese Überladung erstellt auch ein Standardobjekt CngKeyCreationParameters , das einen Standardparameter CngProvider und andere erweiterte Parameter für den Schlüssel angibt.

Gilt für:

Create(CngAlgorithm, String, CngKeyCreationParameters)

Quelle:
Cng.NotSupported.cs
Quelle:
Cng.NotSupported.cs
Quelle:
Cng.NotSupported.cs

Erstellt ein benanntes CngKey-Objekt, das den angegebenen Algorithmus bereitstellt und die angegebenen Schlüsselerstellungsparameter verwendet.

public:
 static System::Security::Cryptography::CngKey ^ Create(System::Security::Cryptography::CngAlgorithm ^ algorithm, System::String ^ keyName, System::Security::Cryptography::CngKeyCreationParameters ^ creationParameters);
public static System.Security.Cryptography.CngKey Create (System.Security.Cryptography.CngAlgorithm algorithm, string keyName, System.Security.Cryptography.CngKeyCreationParameters creationParameters);
public static System.Security.Cryptography.CngKey Create (System.Security.Cryptography.CngAlgorithm algorithm, string? keyName, System.Security.Cryptography.CngKeyCreationParameters? creationParameters);
[System.Runtime.Versioning.SupportedOSPlatform("windows")]
public static System.Security.Cryptography.CngKey Create (System.Security.Cryptography.CngAlgorithm algorithm, string? keyName, System.Security.Cryptography.CngKeyCreationParameters? creationParameters);
[System.Security.SecurityCritical]
public static System.Security.Cryptography.CngKey Create (System.Security.Cryptography.CngAlgorithm algorithm, string keyName, System.Security.Cryptography.CngKeyCreationParameters creationParameters);
static member Create : System.Security.Cryptography.CngAlgorithm * string * System.Security.Cryptography.CngKeyCreationParameters -> System.Security.Cryptography.CngKey
[<System.Runtime.Versioning.SupportedOSPlatform("windows")>]
static member Create : System.Security.Cryptography.CngAlgorithm * string * System.Security.Cryptography.CngKeyCreationParameters -> System.Security.Cryptography.CngKey
[<System.Security.SecurityCritical>]
static member Create : System.Security.Cryptography.CngAlgorithm * string * System.Security.Cryptography.CngKeyCreationParameters -> System.Security.Cryptography.CngKey
Public Shared Function Create (algorithm As CngAlgorithm, keyName As String, creationParameters As CngKeyCreationParameters) As CngKey

Parameter

algorithm
CngAlgorithm

Der Algorithmus, mit dem der Schlüssel verwendet wird.

keyName
String

Der Name des Schlüssels. Wenn kein Name bereitgestellt wird, wird der Schlüssel nicht beibehalten.

creationParameters
CngKeyCreationParameters

Ein Objekt, das erweiterte Parameter für die Methode angibt, einschließlich des CngProvider.

Gibt zurück

Ein beibehaltener oder flüchtiger Schlüssel, der den angegebenen Algorithmus bereitstellt.

Attribute

Ausnahmen

algorithm ist null.

Cryptography Next Generation (CNG) wird auf diesem System nicht unterstützt.

Alle anderen Fehler.

Hinweise

Wenn keyName angegeben, wird durch diese Überladung ein dauerhafter Schlüssel erstellt. Wenn keyName nicht angegeben wird, ist der Schlüssel kurzlebig.

Gilt für: