{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "profile": {
      "type": "string",
      "const": "owp-market-local/0.2"
    },
    "box": {
      "type": "object",
      "properties": {
        "enc": {
          "type": "string",
          "pattern": "^[A-Za-z0-9+/]{87}=$"
        },
        "ciphertext": {
          "type": "string",
          "minLength": 24,
          "maxLength": 20000,
          "pattern": "^[A-Za-z0-9+/]+={0,2}$"
        }
      },
      "required": [
        "enc",
        "ciphertext"
      ],
      "additionalProperties": false,
      "description": "HPKE P-256/HKDF-SHA256/AES-256-GCM. Standard padded base64, not base64url. AAD binds profile, instance, agent, session, request, path, target and direction."
    },
    "signature": {
      "type": "string",
      "pattern": "^[A-Za-z0-9+/]{86}==$"
    }
  },
  "required": [
    "profile",
    "box",
    "signature"
  ],
  "additionalProperties": false,
  "description": "Verify the broker signature over response AAD, LF, enc, LF, ciphertext before decrypting.",
  "title": "EncryptedResponse",
  "$comment": "owp-market-local/0.2; fictional loopback market, non-redeemable test credits only."
}
