{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/coincover/main/json-schema/coincover-secure-data-request-schema.json",
  "title": "SecureDataRequest",
  "x-generated": "2026-10-09",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/_original/coincover-institutional-openapi-openapi.json#/components/schemas/SecureDataRequest",
  "type": "object",
  "required": [
    "public_key",
    "data"
  ],
  "properties": {
    "public_key": {
      "type": "string",
      "pattern": "^[0-9a-fA-F]+$",
      "minLength": 32,
      "maxLength": 4096,
      "description": "Public key in hex format used to encrypt the data"
    },
    "checksum": {
      "type": "string",
      "pattern": "^[a-fA-F0-9]{64}$",
      "description": "SHA-256 checksum of the original plaintext for verification (optional but recommended)"
    },
    "data": {
      "type": "string",
      "format": "base64",
      "description": "Base64-encoded encrypted data"
    },
    "padding_type": {
      "type": "string",
      "enum": [
        "OAEP"
      ],
      "default": "OAEP",
      "description": "Padding type used for encryption"
    },
    "metadata": {
      "type": "object",
      "description": "Optional metadata about the data",
      "properties": {
        "description": {
          "type": "string",
          "description": "Human-readable description of the data"
        },
        "content_type": {
          "type": "string",
          "description": "MIME type of the original data"
        },
        "original_filename": {
          "type": "string",
          "description": "Original filename of the data"
        }
      }
    }
  }
}