KeyVaultClientExtensions.CreateKeyAsync Method

Definition

Overloads

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

Creates a new key, stores it, then returns key parameters and attributes to the client.

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

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 = null);
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>

Parameters

operations
IKeyVaultClient
vaultBaseUrl
String
keyName
String
parameters
NewKeyParameters
cancellationToken
CancellationToken

Returns

Task<KeyBundle>

Applies to

Product Introduced

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

Creates a new key, stores it, then returns key parameters and attributes to the client.

public static System.Threading.Tasks.Task<Microsoft.Azure.KeyVault.Models.KeyBundle> CreateKeyAsync (this Microsoft.Azure.KeyVault.IKeyVaultClient operations, string vaultBaseUrl, string keyName, string kty, Nullable<int> keySize = null, System.Collections.Generic.IList<string> keyOps = null, Microsoft.Azure.KeyVault.Models.KeyAttributes keyAttributes = null, System.Collections.Generic.IDictionary<string,string> tags = null, System.Threading.CancellationToken cancellationToken = null);
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> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Azure.KeyVault.Models.KeyBundle>

Parameters

operations
IKeyVaultClient

The operations group for this extension method.

vaultBaseUrl
String

The vault name, for example https://myvault.vault.azure.net.

keyName
String

The name for the new key. The system will generate the version name for the new key.

kty
String

The type of key to create. For valid values, see JsonWebKeyType. Possible values include: 'EC', 'EC-HSM', 'RSA', 'RSA-HSM', 'oct'

keySize
Nullable<Int32>

The key size in bytes. For example, 1024 or 2048.

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

Application specific metadata in the form of key-value pairs.

cancellationToken
CancellationToken

The cancellation token.

Returns

Task<KeyBundle>

Remarks

The create key operation can be used to create any key type in Azure Key

Vault. If the named key already exists, Azure Key Vault creates a new

version of the key.

Applies to

Product Introduced