{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://openeik.org/schemas/0.1/proposed/review/host-keys.schema.json",
  "$comment": "Proposed for OpenEik 0.2: Part XVIII, review and issue. Written by hand from Part XVIII, not generated: tools/generate-schemas.mjs keeps this folder and lists none of it in index.json. No file of a building is held to it: a host serves the file at /.well-known/openeik/host-keys.json on its origin, and a verifier holds a file it fetches or is given to it (@openeik/tools: readHostKeys, verifyReceipts).",
  "title": "A host's keys",
  "description": "The keys a host signs its receipts and its attestations of terms accepted with (Part XVIII, 5.6, proposed for 0.2), which a verifier takes as trust anchors (XVIII.5.3, rule 7): the host as people know it, the host.name of its receipts; and its keys, each in the shape of a key of the registry (Part XIV, 5.1) with no rpId, the window it signs in from validFrom and before validUntil. A retired key keeps its validUntil and stays listed, a key id is never used again, and a key is never removed once the host has signed with it; a validator checks in code that each key id is listed once, that a public key is of its algorithm and that no window ends before it begins.",
  "type": "object",
  "properties": {
    "format": {
      "const": "openeik-host-keys/0.1"
    },
    "host": {
      "description": "The host, as people know it: never its URL. It is the host.name of every receipt and attestation the host signs with a key of the file (XVIII.5.6, rule 2).",
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "minLength": 1,
          "maxLength": 120
        }
      },
      "required": [
        "name"
      ],
      "x-eik-closed": true
    },
    "keys": {
      "type": "array",
      "minItems": 1,
      "maxItems": 100,
      "items": {
        "description": "A key, as a key of the registry is (Part XIV, 5.1): its id, unique in the file and never used again; its algorithm, ed25519 or ecdsa-p256; the public key, base64 of its DER SubjectPublicKeyInfo; and the window it signs in. A host signs as no passkey, so a host's key has no rpId.",
        "$ref": "../drawings/person.schema.json#/$defs/key",
        "not": {
          "required": [
            "rpId"
          ]
        }
      }
    }
  },
  "required": [
    "format",
    "host",
    "keys"
  ],
  "x-eik-closed": true
}
