Delete Key - Delete Key

Deletes a key of any type from storage in Azure Key Vault.
The delete key operation cannot be used to remove individual versions of a key. This operation removes the cryptographic material associated with the key, which means the key is not usable for Sign/Verify, Wrap/Unwrap or Encrypt/Decrypt operations. This operation requires the keys/delete permission.

DELETE {vaultBaseUrl}/keys/{key-name}?api-version=7.0

URI Parameters

Name In Required Type Description
vaultBaseUrl
path True
  • string

The vault name, for example https://myvault.vault.azure.net.

key-name
path True
  • string

The name of the key to delete.

api-version
query True
  • string

Client API version.

Responses

Name Type Description
200 OK

The public part of the deleted key and deletion information on when the key will be purged.

Other Status Codes

Key Vault error response describing why the operation failed.

Examples

Delete key

Sample Request

DELETE {vaultBaseUrl}/keys/CreateSoftKeyTest?api-version=7.0

Sample Response

{
  "recoveryId": "https://kv-sdk-test.vault-int.azure-int.net/deletedkeys/CreateSoftKeyTest",
  "deletedDate": 1493942452,
  "scheduledPurgeDate": 1501718452,
  "key": {
    "kid": "https://kv-sdk-test.vault-int.azure-int.net/keys/CreateSoftKeyTest/78deebed173b48e48f55abf87ed4cf71",
    "kty": "RSA",
    "key_ops": [
      "encrypt",
      "decrypt",
      "sign",
      "verify",
      "wrapKey",
      "unwrapKey"
    ],
    "n": "2HJAE5fU3Cw2Rt9hEuq-F6XjINKGa-zskfISVqopqUy60GOs2eyhxbWbJBeUXNor_gf-tXtNeuqeBgitLeVa640UDvnEjYTKWjCniTxZRaU7ewY8BfTSk-7KxoDdLsPSpX_MX4rwlAx-_1UGk5t4sQgTbm9T6Fm2oqFd37dsz5-Gj27UP2GTAShfJPFD7MqU_zIgOI0pfqsbNL5xTQVM29K6rX4jSPtylZV3uWJtkoQIQnrIHhk1d0SC0KwlBV3V7R_LVYjiXLyIXsFzSNYgQ68ZjAwt8iL7I8Osa-ehQLM13DVvLASaf7Jnu3sC3CWl3Gyirgded6cfMmswJzY87w",
    "e": "AQAB"
  },
  "attributes": {
    "enabled": true,
    "created": 1493942451,
    "updated": 1493942451,
    "recoveryLevel": "Recoverable+Purgeable"
  },
  "tags": {
    "purpose": "unit test",
    "test name ": "CreateGetDeleteKeyTest"
  }
}

Definitions

DeletedKeyBundle

A DeletedKeyBundle consisting of a WebKey plus its Attributes and deletion info

DeletionRecoveryLevel

Reflects the deletion recovery level currently in effect for keys in the current vault. If it contains 'Purgeable' the key can be permanently deleted by a privileged user; otherwise, only the system can purge the key, at the end of the retention interval.

Error

The key vault server error.

JsonWebKey

As of http://tools.ietf.org/html/draft-ietf-jose-json-web-key-18

JsonWebKeyCurveName

Elliptic curve name. For valid values, see JsonWebKeyCurveName.

JsonWebKeyType

JsonWebKey Key Type (kty), as defined in https://tools.ietf.org/html/draft-ietf-jose-json-web-algorithms-40.

KeyAttributes

The attributes of a key managed by the key vault service.

KeyVaultError

The key vault error exception.

DeletedKeyBundle

A DeletedKeyBundle consisting of a WebKey plus its Attributes and deletion info

Name Type Description
attributes

The key management attributes.

deletedDate
  • integer

The time when the key was deleted, in UTC

key

The Json web key.

managed
  • boolean

True if the key's lifetime is managed by key vault. If this is a key backing a certificate, then managed will be true.

recoveryId
  • string

The url of the recovery object, used to identify and recover the deleted key.

scheduledPurgeDate
  • integer

The time when the key is scheduled to be purged, in UTC

tags
  • object

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

DeletionRecoveryLevel

Reflects the deletion recovery level currently in effect for keys in the current vault. If it contains 'Purgeable' the key can be permanently deleted by a privileged user; otherwise, only the system can purge the key, at the end of the retention interval.

Name Type Description
Purgeable
  • string
Recoverable
  • string
Recoverable+ProtectedSubscription
  • string
Recoverable+Purgeable
  • string

Error

The key vault server error.

Name Type Description
code
  • string

The error code.

innererror

The key vault server error.

message
  • string

The error message.

JsonWebKey

As of http://tools.ietf.org/html/draft-ietf-jose-json-web-key-18

Name Type Description
crv

Elliptic curve name. For valid values, see JsonWebKeyCurveName.

d
  • string

RSA private exponent, or the D component of an EC private key.

dp
  • string

RSA private key parameter.

dq
  • string

RSA private key parameter.

e
  • string

RSA public exponent.

k
  • string

Symmetric key.

key_hsm
  • string

HSM Token, used with 'Bring Your Own Key'.

key_ops
  • string[]

Supported key operations.

kid
  • string

Key identifier.

kty

JsonWebKey Key Type (kty), as defined in https://tools.ietf.org/html/draft-ietf-jose-json-web-algorithms-40.

n
  • string

RSA modulus.

p
  • string

RSA secret prime.

q
  • string

RSA secret prime, with p < q.

qi
  • string

RSA private key parameter.

x
  • string

X component of an EC public key.

y
  • string

Y component of an EC public key.

JsonWebKeyCurveName

Elliptic curve name. For valid values, see JsonWebKeyCurveName.

Name Type Description
P-256
  • string

The NIST P-256 elliptic curve, AKA SECG curve SECP256R1.

P-256K
  • string

The SECG SECP256K1 elliptic curve.

P-384
  • string

The NIST P-384 elliptic curve, AKA SECG curve SECP384R1.

P-521
  • string

The NIST P-521 elliptic curve, AKA SECG curve SECP521R1.

JsonWebKeyType

JsonWebKey Key Type (kty), as defined in https://tools.ietf.org/html/draft-ietf-jose-json-web-algorithms-40.

Name Type Description
EC
  • string

Elliptic Curve.

EC-HSM
  • string

Elliptic Curve with a private key which is not exportable from the HSM.

RSA
  • string

RSA (https://tools.ietf.org/html/rfc3447)

RSA-HSM
  • string

RSA with a private key which is not exportable from the HSM.

oct
  • string

Octet sequence (used to represent symmetric keys)

KeyAttributes

The attributes of a key managed by the key vault service.

Name Type Description
created
  • integer

Creation time in UTC.

enabled
  • boolean

Determines whether the object is enabled.

exp
  • integer

Expiry date in UTC.

nbf
  • integer

Not before date in UTC.

recoveryLevel

Reflects the deletion recovery level currently in effect for keys in the current vault. If it contains 'Purgeable' the key can be permanently deleted by a privileged user; otherwise, only the system can purge the key, at the end of the retention interval.

updated
  • integer

Last updated time in UTC.

KeyVaultError

The key vault error exception.

Name Type Description
error

The key vault server error.