Sdílet prostřednictvím


KeyClient.ImportKey Method

Definition

Overloads

ImportKey(ImportKeyOptions, CancellationToken)

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

ImportKey(String, JsonWebKey, CancellationToken)

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

ImportKey(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 Azure.Response<Azure.Security.KeyVault.Keys.KeyVaultKey> ImportKey (Azure.Security.KeyVault.Keys.ImportKeyOptions importKeyOptions, System.Threading.CancellationToken cancellationToken = default);
abstract member ImportKey : Azure.Security.KeyVault.Keys.ImportKeyOptions * System.Threading.CancellationToken -> Azure.Response<Azure.Security.KeyVault.Keys.KeyVaultKey>
override this.ImportKey : Azure.Security.KeyVault.Keys.ImportKeyOptions * System.Threading.CancellationToken -> Azure.Response<Azure.Security.KeyVault.Keys.KeyVaultKey>
Public Overridable Function ImportKey (importKeyOptions As ImportKeyOptions, Optional cancellationToken As CancellationToken = Nothing) As 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

ImportKey(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 Azure.Response<Azure.Security.KeyVault.Keys.KeyVaultKey> ImportKey (string name, Azure.Security.KeyVault.Keys.JsonWebKey keyMaterial, System.Threading.CancellationToken cancellationToken = default);
abstract member ImportKey : string * Azure.Security.KeyVault.Keys.JsonWebKey * System.Threading.CancellationToken -> Azure.Response<Azure.Security.KeyVault.Keys.KeyVaultKey>
override this.ImportKey : string * Azure.Security.KeyVault.Keys.JsonWebKey * System.Threading.CancellationToken -> Azure.Response<Azure.Security.KeyVault.Keys.KeyVaultKey>
Public Overridable Function ImportKey (name As String, keyMaterial As JsonWebKey, Optional cancellationToken As CancellationToken = Nothing) As 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.

Applies to