{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/x-road-global/json-schema/x-road-global-certificate-details-schema.json",
  "title": "CertificateDetails",
  "description": "certificate details for any kind of certificate (TLS, auth, sign)",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/x-road-global-security-server-admin-openapi.yml#/components/schemas/CertificateDetails",
  "type": "object",
  "required": [
    "issuer_distinguished_name",
    "issuer_common_name",
    "subject_distinguished_name",
    "subject_common_name",
    "not_before",
    "not_after",
    "serial",
    "version",
    "signature_algorithm",
    "signature",
    "public_key_algorithm",
    "rsa_public_key_modulus",
    "rsa_public_key_exponent",
    "hash",
    "key_usages",
    "subject_alternative_names"
  ],
  "properties": {
    "issuer_distinguished_name": {
      "type": "string",
      "format": "text",
      "description": "certificate issuer distinguished name",
      "minLength": 1,
      "maxLength": 255
    },
    "issuer_common_name": {
      "type": "string",
      "format": "text",
      "description": "certificate issuer common name",
      "minLength": 1,
      "maxLength": 255
    },
    "subject_distinguished_name": {
      "type": "string",
      "format": "text",
      "description": "certificate subject distinguished name",
      "minLength": 1,
      "maxLength": 255
    },
    "subject_common_name": {
      "type": "string",
      "format": "text",
      "description": "certificate subject common name",
      "minLength": 1,
      "maxLength": 255
    },
    "not_before": {
      "type": "string",
      "format": "date-time",
      "description": "certificate validity not before",
      "minLength": 24,
      "maxLength": 24
    },
    "not_after": {
      "type": "string",
      "format": "date-time",
      "description": "certificate validity not after",
      "minLength": 24,
      "maxLength": 24
    },
    "serial": {
      "type": "string",
      "format": "text",
      "description": "serial number",
      "minLength": 1,
      "maxLength": 255
    },
    "version": {
      "type": "integer",
      "format": "int32",
      "description": "version"
    },
    "signature_algorithm": {
      "type": "string",
      "format": "sha-256",
      "description": "certificate signature algorithm",
      "minLength": 1,
      "maxLength": 255
    },
    "signature": {
      "type": "string",
      "format": "text",
      "description": "hex encoded certificate signature",
      "minLength": 1,
      "maxLength": 255
    },
    "public_key_algorithm": {
      "type": "string",
      "format": "sha-256",
      "description": "certificate public key algorithm",
      "minLength": 1,
      "maxLength": 255
    },
    "rsa_public_key_modulus": {
      "type": "string",
      "format": "hex",
      "description": "hex encoded RSA public key modulus (if RSA key)",
      "minLength": 1,
      "maxLength": 1000
    },
    "rsa_public_key_exponent": {
      "type": "integer",
      "format": "int32",
      "description": "RSA public key exponent (if RSA key) as an integer"
    },
    "ec_public_parameters": {
      "description": "EC public key curve (if EC key)",
      "format": "text",
      "maxLength": 255,
      "minLength": 1,
      "type": "string"
    },
    "ec_public_key_point": {
      "description": "hex encoded EC public key point (if EC key)",
      "format": "hex",
      "maxLength": 1000,
      "minLength": 1,
      "type": "string"
    },
    "hash": {
      "type": "string",
      "format": "text",
      "description": "certificate SHA-256 hash",
      "minLength": 1,
      "maxLength": 64
    },
    "key_usages": {
      "type": "array",
      "description": "certificate key usage array",
      "uniqueItems": true,
      "items": {
        "$ref": "#/$defs/KeyUsage"
      }
    },
    "subject_alternative_names": {
      "type": "string",
      "format": "text",
      "description": "certificate subject alternative names",
      "minLength": 1,
      "maxLength": 1000
    }
  },
  "$defs": {
    "KeyUsage": {
      "type": "string",
      "description": "certificate key usage",
      "enum": [
        "DIGITAL_SIGNATURE",
        "NON_REPUDIATION",
        "KEY_ENCIPHERMENT",
        "DATA_ENCIPHERMENT",
        "KEY_AGREEMENT",
        "KEY_CERT_SIGN",
        "CRL_SIGN",
        "ENCIPHER_ONLY",
        "DECIPHER_ONLY"
      ]
    }
  }
}