KeyClient.ImportKeyAsync Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
ImportKeyAsync(ImportKeyOptions, CancellationToken) |
Imports an externally created key, stores it, and returns key parameters and attributes to the client. |
ImportKeyAsync(String, JsonWebKey, CancellationToken) |
Imports an externally created key, stores it, and returns key parameters and attributes to the client. |
ImportKeyAsync(ImportKeyOptions, CancellationToken)
- Source:
- KeyClient.cs
- Source:
- KeyClient.cs
Imports an externally created key, stores it, and returns key parameters and attributes to the client.
public virtual System.Threading.Tasks.Task<Azure.Response<Azure.Security.KeyVault.Keys.KeyVaultKey>> ImportKeyAsync (Azure.Security.KeyVault.Keys.ImportKeyOptions importKeyOptions, System.Threading.CancellationToken cancellationToken = default);
abstract member ImportKeyAsync : Azure.Security.KeyVault.Keys.ImportKeyOptions * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response<Azure.Security.KeyVault.Keys.KeyVaultKey>>
override this.ImportKeyAsync : Azure.Security.KeyVault.Keys.ImportKeyOptions * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response<Azure.Security.KeyVault.Keys.KeyVaultKey>>
Public Overridable Function ImportKeyAsync (importKeyOptions As ImportKeyOptions, Optional cancellationToken As CancellationToken = Nothing) As Task(Of Response(Of KeyVaultKey))
Parameters
- importKeyOptions
- ImportKeyOptions
The key import configuration object containing information about the JsonWebKey being imported.
- cancellationToken
- CancellationToken
A CancellationToken controlling the request lifetime.
Returns
The KeyVaultKey that was imported.
Exceptions
importKeyOptions
is null.
The server returned an error. See Message for details returned from the server.
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
ImportKeyAsync(String, JsonWebKey, CancellationToken)
- Source:
- KeyClient.cs
- Source:
- KeyClient.cs
Imports an externally created key, stores it, and returns key parameters and attributes to the client.
public virtual System.Threading.Tasks.Task<Azure.Response<Azure.Security.KeyVault.Keys.KeyVaultKey>> ImportKeyAsync (string name, Azure.Security.KeyVault.Keys.JsonWebKey keyMaterial, System.Threading.CancellationToken cancellationToken = default);
abstract member ImportKeyAsync : string * Azure.Security.KeyVault.Keys.JsonWebKey * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response<Azure.Security.KeyVault.Keys.KeyVaultKey>>
override this.ImportKeyAsync : string * Azure.Security.KeyVault.Keys.JsonWebKey * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response<Azure.Security.KeyVault.Keys.KeyVaultKey>>
Public Overridable Function ImportKeyAsync (name As String, keyMaterial As JsonWebKey, Optional cancellationToken As CancellationToken = Nothing) As Task(Of Response(Of KeyVaultKey))
Parameters
- name
- String
The name of the key.
- keyMaterial
- JsonWebKey
The JsonWebKey being imported.
- cancellationToken
- CancellationToken
A CancellationToken controlling the request lifetime.
Returns
The KeyVaultKey that was imported.
Exceptions
name
is an empty string.
name
or keyMaterial
is null.
The server returned an error. See Message for details returned from the server.
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.