{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/microsoft-azure-key-vault/json-schema/microsoft-azure-key-vault-certificate-bundle-schema.json",
  "title": "CertificateBundle",
  "description": "A certificate bundle consists of a certificate (X509) 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-deletedcertificates-api-openapi.yml#/components/schemas/CertificateBundle",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "The certificate id.",
      "readOnly": true
    },
    "kid": {
      "type": "string",
      "description": "The key id.",
      "readOnly": true
    },
    "sid": {
      "type": "string",
      "description": "The secret id.",
      "readOnly": true
    },
    "x5t": {
      "type": "string",
      "format": "base64url",
      "description": "Thumbprint of the certificate.",
      "readOnly": true,
      "x-ms-client-name": "X509Thumbprint"
    },
    "policy": {
      "$ref": "#/$defs/CertificatePolicy",
      "description": "The management policy.",
      "readOnly": true
    },
    "cer": {
      "type": "string",
      "format": "byte",
      "description": "CER contents of x509 certificate."
    },
    "contentType": {
      "type": "string",
      "description": "The content type of the secret. eg. 'application/x-pem-file' or 'application/x-pkcs12'."
    },
    "attributes": {
      "$ref": "#/$defs/CertificateAttributes",
      "description": "The certificate attributes."
    },
    "tags": {
      "type": "object",
      "description": "Application specific metadata in the form of key-value pairs.",
      "additionalProperties": {
        "type": "string"
      }
    },
    "preserveCertOrder": {
      "type": "boolean",
      "description": "Specifies whether the certificate chain preserves its original order. The default value is false, which sets the leaf certificate at index 0."
    }
  },
  "$defs": {
    "Action": {
      "type": "object",
      "description": "The action that will be executed.",
      "properties": {
        "action_type": {
          "$ref": "#/$defs/CertificatePolicyAction",
          "description": "The type of the action.",
          "x-ms-client-name": "actionType"
        }
      }
    },
    "CertificateAttributes": {
      "type": "object",
      "description": "The certificate management attributes.",
      "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 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.",
          "readOnly": true
        }
      }
    },
    "CertificatePolicy": {
      "type": "object",
      "description": "Management policy for a certificate.",
      "properties": {
        "id": {
          "type": "string",
          "description": "The certificate id.",
          "readOnly": true
        },
        "key_props": {
          "$ref": "#/$defs/KeyProperties",
          "description": "Properties of the key backing a certificate.",
          "x-ms-client-name": "keyProperties"
        },
        "secret_props": {
          "$ref": "#/$defs/SecretProperties",
          "description": "Properties of the secret backing a certificate.",
          "x-ms-client-name": "secretProperties"
        },
        "x509_props": {
          "$ref": "#/$defs/X509CertificateProperties",
          "description": "Properties of the X509 component of a certificate.",
          "x-ms-client-name": "X509CertificateProperties"
        },
        "lifetime_actions": {
          "type": "array",
          "description": "Actions that will be performed by Key Vault over the lifetime of a certificate.",
          "items": {
            "$ref": "#/$defs/LifetimeAction"
          },
          "x-ms-client-name": "lifetimeActions"
        },
        "issuer": {
          "$ref": "#/$defs/IssuerParameters",
          "description": "Parameters for the issuer of the X509 component of a certificate.",
          "x-ms-client-name": "IssuerParameters"
        },
        "attributes": {
          "$ref": "#/$defs/CertificateAttributes",
          "description": "The certificate attributes."
        },
        "platformManaged": {
          "$ref": "#/$defs/PlatformManaged",
          "description": "Configuration that enables the platform to manage the certificate on behalf of the user. This feature is currently intended for internal use only."
        }
      }
    },
    "CertificatePolicyAction": {
      "type": "string",
      "description": "The type of the action.",
      "enum": [
        "EmailContacts",
        "AutoRenew"
      ],
      "x-ms-enum": {
        "name": "CertificatePolicyAction",
        "modelAsString": false,
        "values": [
          {
            "name": "EmailContacts",
            "value": "EmailContacts",
            "description": "A certificate policy that will email certificate contacts."
          },
          {
            "name": "AutoRenew",
            "value": "AutoRenew",
            "description": "A certificate policy that will auto-renew a certificate."
          }
        ]
      }
    },
    "DeletionRecoveryLevel": {
      "type": "string",
      "description": "Reflects the deletion recovery level currently in effect for secrets in the current vault. If it contains 'Purgeable', the secret can be permanently deleted by a privileged user; otherwise, only the system can purge the secret, 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."
          }
        ]
      }
    },
    "IssuerParameters": {
      "type": "object",
      "description": "Parameters for the issuer of the X509 component of a certificate.",
      "properties": {
        "name": {
          "type": "string",
          "description": "Name of the referenced issuer object or reserved names; for example, 'Self' or 'Unknown'."
        },
        "cty": {
          "type": "string",
          "description": "Certificate type as supported by the provider (optional); for example 'OV-SSL', 'EV-SSL'",
          "x-ms-client-name": "CertificateType"
        },
        "cert_transparency": {
          "type": "boolean",
          "description": "Indicates if the certificates generated under this policy should be published to certificate transparency logs.",
          "x-ms-client-name": "CertificateTransparency"
        }
      }
    },
    "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": "P_256",
            "value": "P-256",
            "description": "The NIST P-256 elliptic curve, AKA SECG curve SECP256R1."
          },
          {
            "name": "P_384",
            "value": "P-384",
            "description": "The NIST P-384 elliptic curve, AKA SECG curve SECP384R1."
          },
          {
            "name": "P_521",
            "value": "P-521",
            "description": "The NIST P-521 elliptic curve, AKA SECG curve SECP521R1."
          },
          {
            "name": "P_256K",
            "value": "P-256K",
            "description": "The SECG SECP256K1 elliptic curve."
          }
        ]
      }
    },
    "JsonWebKeyType": {
      "type": "string",
      "description": "The type of key pair to be used for the certificate.",
      "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 not exportable from 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 not exportable from the HSM."
          },
          {
            "name": "oct",
            "value": "oct",
            "description": "Octet sequence (used to represent symmetric keys)."
          },
          {
            "name": "oct_HSM",
            "value": "oct-HSM",
            "description": "Octet sequence with a private key which is not exportable from the HSM."
          }
        ]
      }
    },
    "KeyProperties": {
      "type": "object",
      "description": "Properties of the key pair backing a certificate.",
      "properties": {
        "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."
        },
        "kty": {
          "$ref": "#/$defs/JsonWebKeyType",
          "description": "The type of key pair to be used for the certificate.",
          "x-ms-client-name": "keyType"
        },
        "key_size": {
          "type": "integer",
          "format": "int32",
          "description": "The key size in bits. For example: 2048, 3072, or 4096 for RSA.",
          "x-ms-client-name": "keySize"
        },
        "reuse_key": {
          "type": "boolean",
          "description": "Indicates if the same key pair will be used on certificate renewal.",
          "x-ms-client-name": "reuseKey"
        },
        "crv": {
          "$ref": "#/$defs/JsonWebKeyCurveName",
          "description": "Elliptic curve name. For valid values, see JsonWebKeyCurveName.",
          "x-ms-client-name": "curve"
        }
      }
    },
    "KeyUsageType": {
      "type": "string",
      "description": "Supported usages of a certificate key.",
      "enum": [
        "digitalSignature",
        "nonRepudiation",
        "keyEncipherment",
        "dataEncipherment",
        "keyAgreement",
        "keyCertSign",
        "cRLSign",
        "encipherOnly",
        "decipherOnly"
      ],
      "x-ms-enum": {
        "name": "KeyUsageType",
        "modelAsString": true,
        "values": [
          {
            "name": "digitalSignature",
            "value": "digitalSignature",
            "description": "Indicates that the certificate key can be used as a digital signature."
          },
          {
            "name": "nonRepudiation",
            "value": "nonRepudiation",
            "description": "Indicates that the certificate key can be used for authentication."
          },
          {
            "name": "keyEncipherment",
            "value": "keyEncipherment",
            "description": "Indicates that the certificate key can be used for key encryption."
          },
          {
            "name": "dataEncipherment",
            "value": "dataEncipherment",
            "description": "Indicates that the certificate key can be used for data encryption."
          },
          {
            "name": "keyAgreement",
            "value": "keyAgreement",
            "description": "Indicates that the certificate key can be used to determine key agreement, such as a key created using the Diffie-Hellman key agreement algorithm."
          },
          {
            "name": "keyCertSign",
            "value": "keyCertSign",
            "description": "Indicates that the certificate key can be used to sign certificates."
          },
          {
            "name": "cRLSign",
            "value": "cRLSign",
            "description": "Indicates that the certificate key can be used to sign a certificate revocation list."
          },
          {
            "name": "encipherOnly",
            "value": "encipherOnly",
            "description": "Indicates that the certificate key can be used for encryption only."
          },
          {
            "name": "decipherOnly",
            "value": "decipherOnly",
            "description": "Indicates that the certificate key can be used for decryption only."
          }
        ]
      }
    },
    "LifetimeAction": {
      "type": "object",
      "description": "Action and its trigger that will be performed by Key Vault over the lifetime of a certificate.",
      "properties": {
        "trigger": {
          "$ref": "#/$defs/Trigger",
          "description": "The condition that will execute the action."
        },
        "action": {
          "$ref": "#/$defs/Action",
          "description": "The action that will be executed."
        }
      }
    },
    "PlatformManaged": {
      "type": "object",
      "description": "Properties of the platform managed certificate. This feature is currently intended for internal use only.",
      "properties": {
        "certificateUsage": {
          "type": "string",
          "description": "The intended usage of the certificate."
        },
        "metadata": {
          "type": "object",
          "description": "JSON-formatted platform managed metadata. The schema is intentionally undefined as this feature is currently intended for internal use only.",
          "additionalProperties": {}
        }
      },
      "required": [
        "certificateUsage"
      ]
    },
    "SecretProperties": {
      "type": "object",
      "description": "Properties of the key backing a certificate.",
      "properties": {
        "contentType": {
          "type": "string",
          "description": "The media type (MIME type)."
        }
      }
    },
    "SubjectAlternativeNames": {
      "type": "object",
      "description": "The Subject Alternative Names of a X509 object.",
      "properties": {
        "emails": {
          "type": "array",
          "description": "Email addresses.",
          "items": {
            "type": "string"
          }
        },
        "dns_names": {
          "type": "array",
          "description": "Domain Names.",
          "items": {
            "type": "string"
          },
          "x-ms-client-name": "dnsNames"
        },
        "upns": {
          "type": "array",
          "description": "User Principal Names.",
          "items": {
            "type": "string"
          }
        },
        "uris": {
          "type": "array",
          "description": "Uniform Resource Identifiers.",
          "items": {
            "type": "string"
          }
        },
        "ipAddresses": {
          "type": "array",
          "description": "IP addresses; supports IPv4 and IPv6.",
          "items": {
            "type": "string"
          }
        }
      }
    },
    "Trigger": {
      "type": "object",
      "description": "A condition to be satisfied for an action to be executed.",
      "properties": {
        "lifetime_percentage": {
          "type": "integer",
          "format": "int32",
          "description": "Percentage of lifetime at which to trigger. Value should be between 1 and 99.",
          "minimum": 1,
          "maximum": 99,
          "x-ms-client-name": "lifetimePercentage"
        },
        "days_before_expiry": {
          "type": "integer",
          "format": "int32",
          "description": "Days before expiry to attempt renewal. Value should be between 1 and validity_in_months multiplied by 27. If validity_in_months is 36, then value should be between 1 and 972 (36 * 27).",
          "x-ms-client-name": "daysBeforeExpiry"
        }
      }
    },
    "X509CertificateProperties": {
      "type": "object",
      "description": "Properties of the X509 component of a certificate.",
      "properties": {
        "subject": {
          "type": "string",
          "description": "The subject name. Should be a valid X509 distinguished Name."
        },
        "ekus": {
          "type": "array",
          "description": "The enhanced key usage.",
          "items": {
            "type": "string"
          }
        },
        "sans": {
          "$ref": "#/$defs/SubjectAlternativeNames",
          "description": "The subject alternative names.",
          "x-ms-client-name": "subjectAlternativeNames"
        },
        "key_usage": {
          "type": "array",
          "description": "Defines how the certificate's key may be used.",
          "items": {
            "$ref": "#/$defs/KeyUsageType"
          },
          "x-ms-client-name": "keyUsage"
        },
        "validity_months": {
          "type": "integer",
          "format": "int32",
          "description": "The duration that the certificate is valid in months.",
          "minimum": 0,
          "x-ms-client-name": "ValidityInMonths"
        }
      }
    }
  }
}