KeyVaultClientExtensions.ImportKeyAsync Method

Definition

Overloads

ImportKeyAsync(IKeyVaultClient, String, String, KeyBundle, Nullable<Boolean>, CancellationToken)

Imports a key into the specified vault

ImportKeyAsync(IKeyVaultClient, String, String, JsonWebKey, Nullable<Boolean>, KeyAttributes, IDictionary<String,String>, CancellationToken)

Imports an externally created key, stores it, and returns key parameters and attributes to the client.

ImportKeyAsync(IKeyVaultClient, String, String, KeyBundle, Nullable<Boolean>, CancellationToken)

Imports a key into the specified vault

public static System.Threading.Tasks.Task<Microsoft.Azure.KeyVault.Models.KeyBundle> ImportKeyAsync (this Microsoft.Azure.KeyVault.IKeyVaultClient operations, string vaultBaseUrl, string keyName, Microsoft.Azure.KeyVault.Models.KeyBundle keyBundle, Nullable<bool> importToHardware = null, System.Threading.CancellationToken cancellationToken = null);
static member ImportKeyAsync : Microsoft.Azure.KeyVault.IKeyVaultClient * string * string * Microsoft.Azure.KeyVault.Models.KeyBundle * Nullable<bool> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Azure.KeyVault.Models.KeyBundle>

Parameters

operations
IKeyVaultClient
vaultBaseUrl
String

The vault name, e.g. https://myvault.vault.azure.net

keyName
String

The key name

keyBundle
KeyBundle

Key bundle

importToHardware
Nullable<Boolean>

Whether to import as a hardware key (HSM) or software key

cancellationToken
CancellationToken

Optional cancellation token

Returns

Task<KeyBundle>

Imported key bundle to the vault

Applies to

Product Introduced

ImportKeyAsync(IKeyVaultClient, String, String, JsonWebKey, Nullable<Boolean>, KeyAttributes, IDictionary<String,String>, CancellationToken)

Imports an externally created key, stores it, and returns key parameters and attributes to the client.

public static System.Threading.Tasks.Task<Microsoft.Azure.KeyVault.Models.KeyBundle> ImportKeyAsync (this Microsoft.Azure.KeyVault.IKeyVaultClient operations, string vaultBaseUrl, string keyName, Microsoft.Azure.KeyVault.WebKey.JsonWebKey key, Nullable<bool> hsm = null, Microsoft.Azure.KeyVault.Models.KeyAttributes keyAttributes = null, System.Collections.Generic.IDictionary<string,string> tags = null, System.Threading.CancellationToken cancellationToken = null);
static member ImportKeyAsync : Microsoft.Azure.KeyVault.IKeyVaultClient * string * string * Microsoft.Azure.KeyVault.WebKey.JsonWebKey * Nullable<bool> * 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

Name for the imported key.

key
JsonWebKey

The Json web key

hsm
Nullable<Boolean>

Whether to import as a hardware key (HSM) or software key.

keyAttributes
KeyAttributes

The key management attributes.

tags
IDictionary<String,String>

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

cancellationToken
CancellationToken

The cancellation token.

Returns

Task<KeyBundle>

Remarks

The import key operation may be used to import any key type into an Azure

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

version of the key.

Applies to

Product Introduced