Freigeben über


KeyVaultClientExtensions.CreateKeyAsync Methode

Definition

Überlädt

CreateKeyAsync(IKeyVaultClient, String, String, NewKeyParameters, CancellationToken)
CreateKeyAsync(IKeyVaultClient, String, String, String, Nullable<Int32>, IList<String>, KeyAttributes, IDictionary<String,String>, String, CancellationToken)

Erstellt einen neuen Schlüssel, speichert ihn und gibt dann Schlüsselparameter und Attribute an den Client zurück.

CreateKeyAsync(IKeyVaultClient, String, String, NewKeyParameters, CancellationToken)

Quelle:
KeyVaultClientExtensions.cs
public static System.Threading.Tasks.Task<Microsoft.Azure.KeyVault.Models.KeyBundle> CreateKeyAsync (this Microsoft.Azure.KeyVault.IKeyVaultClient operations, string vaultBaseUrl, string keyName, Microsoft.Azure.KeyVault.Models.NewKeyParameters parameters, System.Threading.CancellationToken cancellationToken = default);
static member CreateKeyAsync : Microsoft.Azure.KeyVault.IKeyVaultClient * string * string * Microsoft.Azure.KeyVault.Models.NewKeyParameters * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Azure.KeyVault.Models.KeyBundle>
<Extension()>
Public Function CreateKeyAsync (operations As IKeyVaultClient, vaultBaseUrl As String, keyName As String, parameters As NewKeyParameters, Optional cancellationToken As CancellationToken = Nothing) As Task(Of KeyBundle)

Parameter

operations
IKeyVaultClient
vaultBaseUrl
String
keyName
String
parameters
NewKeyParameters
cancellationToken
CancellationToken

Gibt zurück

Gilt für:

CreateKeyAsync(IKeyVaultClient, String, String, String, Nullable<Int32>, IList<String>, KeyAttributes, IDictionary<String,String>, String, CancellationToken)

Quelle:
KeyVaultClientExtensions.cs

Erstellt einen neuen Schlüssel, speichert ihn und gibt dann Schlüsselparameter und Attribute an den Client zurück.

public static System.Threading.Tasks.Task<Microsoft.Azure.KeyVault.Models.KeyBundle> CreateKeyAsync (this Microsoft.Azure.KeyVault.IKeyVaultClient operations, string vaultBaseUrl, string keyName, string kty, int? keySize = default, System.Collections.Generic.IList<string> keyOps = default, Microsoft.Azure.KeyVault.Models.KeyAttributes keyAttributes = default, System.Collections.Generic.IDictionary<string,string> tags = default, string curve = default, System.Threading.CancellationToken cancellationToken = default);
static member CreateKeyAsync : Microsoft.Azure.KeyVault.IKeyVaultClient * string * string * string * Nullable<int> * System.Collections.Generic.IList<string> * Microsoft.Azure.KeyVault.Models.KeyAttributes * System.Collections.Generic.IDictionary<string, string> * string * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Azure.KeyVault.Models.KeyBundle>
<Extension()>
Public Function CreateKeyAsync (operations As IKeyVaultClient, vaultBaseUrl As String, keyName As String, kty As String, Optional keySize As Nullable(Of Integer) = Nothing, Optional keyOps As IList(Of String) = Nothing, Optional keyAttributes As KeyAttributes = Nothing, Optional tags As IDictionary(Of String, String) = Nothing, Optional curve As String = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Task(Of KeyBundle)

Parameter

operations
IKeyVaultClient

Die Vorgangsgruppe für diese Erweiterungsmethode.

vaultBaseUrl
String

Der Tresorname, z. B https://myvault.vault.azure.net. .

keyName
String

Der Name für den neuen Schlüssel. Das System generiert den Versionsnamen für den neuen Schlüssel.

kty
String

Die Art des zu erstellenden Schlüssels. Gültige Werte finden Sie unter JsonWebKeyType. Mögliche Werte: "EC", "EC-HSM", "RSA", "RSA-HSM", "oct"

keySize
Nullable<Int32>

Die Schlüsselgröße in Bytes. Beispiel: 1024 oder 2048.

keyOps
IList<String>
keyAttributes
KeyAttributes
tags
IDictionary<String,String>

Anwendungsspezifische Metadaten in Form von Schlüssel-Wert-Paaren.

curve
String

Name der elliptischen Kurve. Gültige Werte finden Sie unter JsonWebKeyCurveName. Mögliche Werte: "P-256", "P-384", "P-521", "SECP256K1"

cancellationToken
CancellationToken

Das Abbruchtoken.

Gibt zurück

Hinweise

Der Vorgang zum Erstellen eines Schlüssels kann verwendet werden, um einen beliebigen Schlüsseltyp in Azure Key Vault zu erstellen. Wenn der benannte Schlüssel bereits vorhanden ist, erstellt der Azure-Schlüsseltresor eine neue Version des Schlüssels. Hierfür sind die Schlüssel/create-Berechtigung erforderlich.

Gilt für: