{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/microsoft-azure-key-vault/json-schema/microsoft-azure-key-vault-key-bundle-schema.json",
  "title": "KeyBundle",
  "description": "A KeyBundle consisting of a WebKey plus its attributes.",
  "x-generated": "2026-11-12",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/_superseded/microsoft-azure-key-vault-deletedkeys-api-openapi.yml#/components/schemas/KeyBundle",
  "type": "object",
  "properties": {
    "key": {
      "$ref": "#/$defs/JsonWebKey",
      "description": "The Json web key."
    },
    "attributes": {
      "$ref": "#/$defs/KeyAttributes",
      "description": "The key management attributes."
    },
    "tags": {
      "type": "object",
      "description": "Application specific metadata in the form of key-value pairs.",
      "additionalProperties": {
        "type": "string"
      }
    },
    "managed": {
      "type": "boolean",
      "description": "True if the key's lifetime is managed by key vault. If this is a key backing a certificate, then managed will be true.",
      "readOnly": true
    },
    "release_policy": {
      "$ref": "#/$defs/KeyReleasePolicy",
      "description": "The policy rules under which the key can be exported.",
      "x-ms-client-name": "releasePolicy"
    }
  },
  "$defs": {
    "DeletionRecoveryLevel": {
      "type": "string",
      "description": "Reflects the deletion recovery level currently in effect for certificates in the current vault. If it contains 'Purgeable', the certificate can be permanently deleted by a privileged user; otherwise, only the system can purge the certificate, at the end of the retention interval.",
      "enum": [
        "Purgeable",
        "Recoverable+Purgeable",
        "Recoverable",
        "Recoverable+ProtectedSubscription",
        "CustomizedRecoverable+Purgeable",
        "CustomizedRecoverable",
        "CustomizedRecoverable+ProtectedSubscription"
      ],
      "x-ms-enum": {
        "name": "DeletionRecoveryLevel",
        "modelAsString": true,
        "values": [
          {
            "name": "Purgeable",
            "value": "Purgeable",
            "description": "Denotes a vault state in which deletion is an irreversible operation, without the possibility for recovery. This level corresponds to no protection being available against a Delete operation; the data is irretrievably lost upon accepting a Delete operation at the entity level or higher (vault, resource group, subscription etc.)"
          },
          {
            "name": "RecoverablePurgeable",
            "value": "Recoverable+Purgeable",
            "description": "Denotes a vault state in which deletion is recoverable, and which also permits immediate and permanent deletion (i.e. purge). This level guarantees the recoverability of the deleted entity during the retention interval (90 days), unless a Purge operation is requested, or the subscription is cancelled. System wil permanently delete it after 90 days, if not recovered"
          },
          {
            "name": "Recoverable",
            "value": "Recoverable",
            "description": "Denotes a vault state in which deletion is recoverable without the possibility for immediate and permanent deletion (i.e. purge). This level guarantees the recoverability of the deleted entity during the retention interval(90 days) and while the subscription is still available. System wil permanently delete it after 90 days, if not recovered"
          },
          {
            "name": "RecoverableProtectedSubscription",
            "value": "Recoverable+ProtectedSubscription",
            "description": "Denotes a vault and subscription state in which deletion is recoverable within retention interval (90 days), immediate and permanent deletion (i.e. purge) is not permitted, and in which the subscription itself  cannot be permanently canceled. System wil permanently delete it after 90 days, if not recovered"
          },
          {
            "name": "CustomizedRecoverablePurgeable",
            "value": "CustomizedRecoverable+Purgeable",
            "description": "Denotes a vault state in which deletion is recoverable, and which also permits immediate and permanent deletion (i.e. purge when 7 <= SoftDeleteRetentionInDays < 90). This level guarantees the recoverability of the deleted entity during the retention interval, unless a Purge operation is requested, or the subscription is cancelled."
          },
          {
            "name": "CustomizedRecoverable",
            "value": "CustomizedRecoverable",
            "description": "Denotes a vault state in which deletion is recoverable without the possibility for immediate and permanent deletion (i.e. purge when 7 <= SoftDeleteRetentionInDays < 90).This level guarantees the recoverability of the deleted entity during the retention interval and while the subscription is still available."
          },
          {
            "name": "CustomizedRecoverableProtectedSubscription",
            "value": "CustomizedRecoverable+ProtectedSubscription",
            "description": "Denotes a vault and subscription state in which deletion is recoverable, immediate and permanent deletion (i.e. purge) is not permitted, and in which the subscription itself cannot be permanently canceled when 7 <= SoftDeleteRetentionInDays < 90. This level guarantees the recoverability of the deleted entity during the retention interval, and also reflects the fact that the subscription itself cannot be cancelled."
          }
        ]
      }
    },
    "ExternalKey": {
      "type": "object",
      "description": "External Key parameters.",
      "properties": {
        "id": {
          "type": "string",
          "description": "The external key identifier. The valid id can only contain characters in the set [a-zA-Z0-9-]. Maximum length is 64 characters."
        }
      },
      "required": [
        "id"
      ]
    },
    "JsonWebKey": {
      "type": "object",
      "description": "As of http://tools.ietf.org/html/draft-ietf-jose-json-web-key-18",
      "properties": {
        "kid": {
          "type": "string",
          "description": "Key identifier."
        },
        "kty": {
          "$ref": "#/$defs/JsonWebKeyType",
          "description": "JsonWebKey Key Type (kty), as defined in https://tools.ietf.org/html/draft-ietf-jose-json-web-algorithms-40."
        },
        "key_ops": {
          "type": "array",
          "description": "Json web key operations. For more information on possible key operations, see JsonWebKeyOperation.",
          "items": {
            "type": "string"
          },
          "x-ms-client-name": "keyOps"
        },
        "n": {
          "type": "string",
          "format": "base64url",
          "description": "RSA modulus."
        },
        "e": {
          "type": "string",
          "format": "base64url",
          "description": "RSA public exponent."
        },
        "d": {
          "type": "string",
          "format": "base64url",
          "description": "RSA private exponent, or the D component of an EC private key."
        },
        "dp": {
          "type": "string",
          "format": "base64url",
          "description": "RSA private key parameter."
        },
        "dq": {
          "type": "string",
          "format": "base64url",
          "description": "RSA private key parameter."
        },
        "qi": {
          "type": "string",
          "format": "base64url",
          "description": "RSA private key parameter."
        },
        "p": {
          "type": "string",
          "format": "base64url",
          "description": "RSA secret prime."
        },
        "q": {
          "type": "string",
          "format": "base64url",
          "description": "RSA secret prime, with p < q."
        },
        "k": {
          "type": "string",
          "format": "base64url",
          "description": "Symmetric key."
        },
        "key_hsm": {
          "type": "string",
          "format": "base64url",
          "description": "Protected Key, used with 'Bring Your Own Key'.",
          "x-ms-client-name": "t"
        },
        "crv": {
          "$ref": "#/$defs/JsonWebKeyCurveName",
          "description": "Elliptic curve name. For valid values, see JsonWebKeyCurveName."
        },
        "x": {
          "type": "string",
          "format": "base64url",
          "description": "X component of an EC public key."
        },
        "y": {
          "type": "string",
          "format": "base64url",
          "description": "Y component of an EC public key."
        }
      }
    },
    "JsonWebKeyCurveName": {
      "type": "string",
      "description": "Elliptic curve name. For valid values, see JsonWebKeyCurveName.",
      "enum": [
        "P-256",
        "P-384",
        "P-521",
        "P-256K"
      ],
      "x-ms-enum": {
        "name": "JsonWebKeyCurveName",
        "modelAsString": true,
        "values": [
          {
            "name": "P256",
            "value": "P-256",
            "description": "The NIST P-256 elliptic curve, AKA SECG curve SECP256R1."
          },
          {
            "name": "P384",
            "value": "P-384",
            "description": "The NIST P-384 elliptic curve, AKA SECG curve SECP384R1."
          },
          {
            "name": "P521",
            "value": "P-521",
            "description": "The NIST P-521 elliptic curve, AKA SECG curve SECP521R1."
          },
          {
            "name": "P256_K",
            "value": "P-256K",
            "description": "The SECG SECP256K1 elliptic curve."
          }
        ]
      }
    },
    "JsonWebKeyType": {
      "type": "string",
      "description": "JsonWebKey Key Type (kty), as defined in https://tools.ietf.org/html/draft-ietf-jose-json-web-algorithms-40.",
      "enum": [
        "EC",
        "EC-HSM",
        "RSA",
        "RSA-HSM",
        "oct",
        "oct-HSM"
      ],
      "x-ms-enum": {
        "name": "JsonWebKeyType",
        "modelAsString": true,
        "values": [
          {
            "name": "EC",
            "value": "EC",
            "description": "Elliptic Curve."
          },
          {
            "name": "EC_HSM",
            "value": "EC-HSM",
            "description": "Elliptic Curve with a private key which is stored in the HSM."
          },
          {
            "name": "RSA",
            "value": "RSA",
            "description": "RSA (https://tools.ietf.org/html/rfc3447)"
          },
          {
            "name": "RSA_HSM",
            "value": "RSA-HSM",
            "description": "RSA with a private key which is stored in the HSM."
          },
          {
            "name": "oct",
            "value": "oct",
            "description": "Octet sequence (used to represent symmetric keys)"
          },
          {
            "name": "oct_HSM",
            "value": "oct-HSM",
            "description": "Octet sequence (used to represent symmetric keys) which is stored the HSM."
          }
        ]
      }
    },
    "KeyAttestation": {
      "type": "object",
      "description": "The key attestation information.",
      "properties": {
        "certificatePemFile": {
          "type": "string",
          "format": "base64url",
          "description": "A base64url-encoded string containing certificates in PEM format, used for attestation validation."
        },
        "privateKeyAttestation": {
          "type": "string",
          "format": "base64url",
          "description": "The attestation blob bytes encoded as base64url string corresponding to a private key."
        },
        "publicKeyAttestation": {
          "type": "string",
          "format": "base64url",
          "description": "The attestation blob bytes encoded as base64url string corresponding to a public key in case of asymmetric key."
        },
        "version": {
          "type": "string",
          "description": "The version of the attestation."
        }
      }
    },
    "KeyAttributes": {
      "type": "object",
      "description": "The attributes of a key managed by the key vault service.",
      "properties": {
        "enabled": {
          "type": "boolean",
          "description": "Determines whether the object is enabled."
        },
        "nbf": {
          "type": "integer",
          "format": "unixtime",
          "description": "Not before date in UTC.",
          "x-ms-client-name": "notBefore"
        },
        "exp": {
          "type": "integer",
          "format": "unixtime",
          "description": "Expiry date in UTC.",
          "x-ms-client-name": "expires"
        },
        "created": {
          "type": "integer",
          "format": "unixtime",
          "description": "Creation time in UTC.",
          "readOnly": true
        },
        "updated": {
          "type": "integer",
          "format": "unixtime",
          "description": "Last updated time in UTC.",
          "readOnly": true
        },
        "recoverableDays": {
          "type": "integer",
          "format": "int32",
          "description": "softDelete data retention days. Value should be >=7 and <=90 when softDelete enabled, otherwise 0.",
          "readOnly": true
        },
        "recoveryLevel": {
          "$ref": "#/$defs/DeletionRecoveryLevel",
          "description": "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.",
          "readOnly": true
        },
        "exportable": {
          "type": "boolean",
          "description": "Indicates if the private key can be exported. Release policy must be provided when creating the first version of an exportable key."
        },
        "hsmPlatform": {
          "type": "string",
          "description": "The underlying HSM Platform.",
          "readOnly": true
        },
        "attestation": {
          "$ref": "#/$defs/KeyAttestation",
          "description": "The key or key version attestation information.",
          "readOnly": true
        },
        "external_key": {
          "$ref": "#/$defs/ExternalKey",
          "description": "The external key information.",
          "x-ms-client-name": "externalKey"
        },
        "key_size": {
          "type": "integer",
          "format": "int32",
          "description": "The optional key size in bits for symmetric keys. For example: 128, 192, or 256 for AES keys.",
          "readOnly": true,
          "x-ms-client-name": "keySize"
        }
      }
    },
    "KeyReleasePolicy": {
      "type": "object",
      "description": "The policy rules under which the key can be exported.",
      "properties": {
        "contentType": {
          "type": "string",
          "description": "Content type and version of key release policy",
          "default": "application/json; charset=utf-8"
        },
        "immutable": {
          "type": "boolean",
          "description": "Defines the mutability state of the policy. Once marked immutable, this flag cannot be reset and the policy cannot be changed under any circumstances."
        },
        "data": {
          "type": "string",
          "format": "base64url",
          "description": "Blob encoding the policy rules under which the key can be released. Blob must be base64 URL encoded.",
          "x-ms-client-name": "encodedPolicy"
        }
      }
    }
  }
}