{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "vaultfire.legal-registry-trust-policy.v1.schema.json",
  "type": "object",
  "additionalProperties": false,
  "required": ["$schema", "schemaVersion", "status", "authorityClass", "expectedRootPath", "expectedRootId", "expectedRootSha256", "expectedIssuerId", "expectedAdministratorId", "blockedReason"],
  "properties": {
    "$schema": {"const": "../schemas/legal-registry-trust-policy.schema.json"},
    "schemaVersion": {"const": "1.0.0"},
    "status": {"enum": ["no-external-authority-established", "pinned-external-authority"]},
    "authorityClass": {"const": "external-legal-entity-registry-authority"},
    "expectedRootPath": {"type": ["string", "null"], "pattern": "^/[^\\u0000]+\\.json$"},
    "expectedRootId": {"type": ["string", "null"], "pattern": "^legal-registry-root:[0-9a-f]{64}$"},
    "expectedRootSha256": {"type": ["string", "null"], "pattern": "^[0-9a-f]{64}$"},
    "expectedIssuerId": {"type": ["string", "null"], "pattern": "^legal-registry-issuer:[0-9a-f]{64}$"},
    "expectedAdministratorId": {"type": ["string", "null"], "pattern": "^authority-admin:[0-9a-f]{64}$"},
    "blockedReason": {"type": ["string", "null"], "minLength": 1}
  }
}
