{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://www.bounder.io/schemas/creedspace-bounder-envelope-v1.schema.json",
  "title": "Creed Space Bounder Signed Envelope v1",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "envelope_version",
    "algorithm",
    "payload",
    "signature",
    "public_key_id"
  ],
  "properties": {
    "envelope_version": {
      "const": "creedspace-bounder-envelope/v1"
    },
    "algorithm": {
      "const": "Ed25519"
    },
    "payload": {
      "type": "string",
      "minLength": 4,
      "maxLength": 1398104,
      "pattern": "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/][AQgw]==|[A-Za-z0-9+/]{2}[AEIMQUYcgkosw048]=)?$",
      "contentEncoding": "base64",
      "contentMediaType": "application/json",
      "description": "Exact UTF-8 bytes of creedspace-bounder-policy/v1. The signature covers the decoded bytes without reserialization."
    },
    "signature": {
      "type": "string",
      "minLength": 88,
      "maxLength": 88,
      "pattern": "^(?:[A-Za-z0-9+/]{4}){21}[A-Za-z0-9+/][AQgw]==$",
      "contentEncoding": "base64"
    },
    "public_key_id": {
      "type": "string",
      "minLength": 1,
      "maxLength": 128,
      "pattern": "\\S"
    }
  }
}
