共用方式為


KeyClient Class

Definition

The KeyClient provides synchronous and asynchronous methods to manage KeyVaultKey in the Azure Key Vault. The client supports creating, retrieving, updating, deleting, purging, backing up, restoring, and listing the KeyVaultKey. The client also supports listing DeletedKey for a soft-delete enabled Azure Key Vault.

public class KeyClient
type KeyClient = class
Public Class KeyClient
Inheritance
KeyClient

Constructors

KeyClient()

Initializes a new instance of the KeyClient class for mocking.

KeyClient(Uri, TokenCredential, KeyClientOptions)

Initializes a new instance of the KeyClient class for the specified vault.

KeyClient(Uri, TokenCredential)

Initializes a new instance of the KeyClient class for the specified vault.

Properties

VaultUri

Gets the Uri of the vault used to create this instance of the KeyClient.

Methods

BackupKey(String, CancellationToken)

Requests that a backup of the specified key be downloaded to the client.

BackupKeyAsync(String, CancellationToken)

Requests that a backup of the specified key be downloaded to the client.

CreateEcKey(CreateEcKeyOptions, CancellationToken)

Creates and stores a new Elliptic Curve key in Key Vault. If the named key already exists, Azure Key Vault creates a new version of the key. This operation requires the keys/create permission.

CreateEcKeyAsync(CreateEcKeyOptions, CancellationToken)

Creates and stores a new Elliptic Curve key in Key Vault. If the named key already exists, Azure Key Vault creates a new version of the key. This operation requires the keys/create permission.

CreateKey(String, KeyType, CreateKeyOptions, CancellationToken)

Creates and stores a new key in Key Vault. 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. This operation requires the keys/create permission.

CreateKeyAsync(String, KeyType, CreateKeyOptions, CancellationToken)

Creates and stores a new key in Key Vault. 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. This operation requires the keys/create permission.

CreateOctKey(CreateOctKeyOptions, CancellationToken)

Creates and stores a new AES key in Key Vault. If the named key already exists, Azure Key Vault creates a new version of the key. This operation requires the keys/create permission.

CreateOctKeyAsync(CreateOctKeyOptions, CancellationToken)

Creates and stores a new AES key in Key Vault. If the named key already exists, Azure Key Vault creates a new version of the key. This operation requires the keys/create permission.

CreateRsaKey(CreateRsaKeyOptions, CancellationToken)

Creates and stores a new RSA key in Key Vault. If the named key already exists, Azure Key Vault creates a new version of the key. This operation requires the keys/create permission.

CreateRsaKeyAsync(CreateRsaKeyOptions, CancellationToken)

Creates and stores a new RSA key in Key Vault. If the named key already exists, Azure Key Vault creates a new version of the key. This operation requires the keys/create permission.

GetCryptographyClient(String, String)

Get a CryptographyClient for the given key.

GetDeletedKey(String, CancellationToken)

Gets the public part of a deleted key.

GetDeletedKeyAsync(String, CancellationToken)

Gets the public part of a deleted key.

GetDeletedKeys(CancellationToken)

Lists the deleted keys in the specified vault.

GetDeletedKeysAsync(CancellationToken)

Lists the deleted keys in the specified vault.

GetKey(String, String, CancellationToken)

Gets the public part of a stored key.

GetKeyAsync(String, String, CancellationToken)

Gets the public part of a stored key.

GetKeyRotationPolicy(String, CancellationToken)

Gets the KeyRotationPolicy for the specified key in Key Vault.

GetKeyRotationPolicyAsync(String, CancellationToken)

Gets the KeyRotationPolicy for the specified key in Key Vault.

GetPropertiesOfKeys(CancellationToken)

Lists the properties of all enabled and disabled keys in the specified vault. You can use the returned Name in subsequent calls to GetKey(String, String, CancellationToken).

GetPropertiesOfKeysAsync(CancellationToken)

Lists the properties of all enabled and disabled keys in the specified vault. You can use the returned Name in subsequent calls to GetKeyAsync(String, String, CancellationToken).

GetPropertiesOfKeyVersions(String, CancellationToken)

Lists the properties of all enabled and disabled versions of the specified key. You can use the returned Name and Version in subsequent calls to GetKey(String, String, CancellationToken).

GetPropertiesOfKeyVersionsAsync(String, CancellationToken)

Lists the properties of all enabled and disabled versions of the specified key. You can use the returned Name and Version in subsequent calls to GetKeyAsync(String, String, CancellationToken).

GetRandomBytes(Int32, CancellationToken)

Get the requested number of bytes containing random values from a managed hardware security module (HSM).

GetRandomBytesAsync(Int32, CancellationToken)

Get the requested number of bytes containing random values from a managed hardware security module (HSM).

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.

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.

PurgeDeletedKey(String, CancellationToken)

Permanently deletes the specified key.

PurgeDeletedKeyAsync(String, CancellationToken)

Permanently deletes the specified key.

ReleaseKey(ReleaseKeyOptions, CancellationToken)

Releases a key.

ReleaseKey(String, String, CancellationToken)

Releases the latest version of a key.

ReleaseKeyAsync(ReleaseKeyOptions, CancellationToken)

Releases a key.

ReleaseKeyAsync(String, String, CancellationToken)

Releases the latest version of a key.

RestoreKeyBackup(Byte[], CancellationToken)

Restores a backed up key to a vault.

RestoreKeyBackupAsync(Byte[], CancellationToken)

Restores a backed up key to a vault.

RotateKey(String, CancellationToken)

Creates a new key version in Key Vault, stores it, then returns the new KeyVaultKey.

RotateKeyAsync(String, CancellationToken)

Creates a new key version in Key Vault, stores it, then returns the new KeyVaultKey.

StartDeleteKey(String, CancellationToken)

Deletes a key of any type from storage in Azure Key Vault.

StartDeleteKeyAsync(String, CancellationToken)

Deletes a key of any type from storage in Azure Key Vault.

StartRecoverDeletedKey(String, CancellationToken)

Recovers the deleted key to its latest version.

StartRecoverDeletedKeyAsync(String, CancellationToken)

Recovers the deleted key to its latest version.

UpdateKeyProperties(KeyProperties, IEnumerable<KeyOperation>, CancellationToken)

The update key operation changes specified attributes of a stored key and can be applied to any key type and key version stored in Azure Key Vault.

UpdateKeyPropertiesAsync(KeyProperties, IEnumerable<KeyOperation>, CancellationToken)

The update key operation changes specified attributes of a stored key and can be applied to any key type and key version stored in Azure Key Vault.

UpdateKeyRotationPolicy(String, KeyRotationPolicy, CancellationToken)

Updates the KeyRotationPolicy for the specified key in Key Vault. The new policy will be used for the next version of the key when rotated.

UpdateKeyRotationPolicyAsync(String, KeyRotationPolicy, CancellationToken)

Updates the KeyRotationPolicy for the specified key in Key Vault. The new policy will be used for the next version of the key when rotated.

Applies to