Dela via


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)

Source:
KeyVaultClientExtensions.cs

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, bool? importToHardware = default, System.Threading.CancellationToken cancellationToken = default);
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>
<Extension()>
Public Function ImportKeyAsync (operations As IKeyVaultClient, vaultBaseUrl As String, keyName As String, keyBundle As KeyBundle, Optional importToHardware As Nullable(Of Boolean) = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Task(Of 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

Imported key bundle to the vault

Applies to

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

Source:
KeyVaultClientExtensions.cs

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, bool? hsm = default, Microsoft.Azure.KeyVault.Models.KeyAttributes keyAttributes = default, System.Collections.Generic.IDictionary<string,string> tags = default, System.Threading.CancellationToken cancellationToken = default);
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>
<Extension()>
Public Function ImportKeyAsync (operations As IKeyVaultClient, vaultBaseUrl As String, keyName As String, key As JsonWebKey, Optional hsm As Nullable(Of Boolean) = Nothing, Optional keyAttributes As KeyAttributes = Nothing, Optional tags As IDictionary(Of String, String) = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Task(Of 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

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. This operation requires the keys/import permission.

Applies to