{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "urn:junexis:schema:registry-snapshot-signature:0.1",
  "title": "Podpisany snapshot Registry 0.1",
  "description": "Wiąże snapshot junexis.registry-snapshot/0.1 z rewizją, terminem ważności i podpisem roli registry-snapshot z magazynu zaufania.",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "schemaVersion",
    "registryId",
    "snapshotId",
    "revision",
    "minimumAcceptedRevision",
    "issuedAt",
    "expiresAt",
    "algorithm",
    "keyId",
    "signature"
  ],
  "properties": {
    "schemaVersion": { "const": "junexis.registry-snapshot-signature/0.1" },
    "registryId": { "type": "string", "pattern": "^[a-z0-9][a-z0-9._-]{1,127}$" },
    "snapshotId": { "$ref": "#/$defs/sha256" },
    "revision": { "type": "integer", "minimum": 1 },
    "minimumAcceptedRevision": { "type": "integer", "minimum": 1 },
    "issuedAt": { "$ref": "#/$defs/timestamp" },
    "expiresAt": { "$ref": "#/$defs/timestamp" },
    "algorithm": { "const": "ecdsa-p256-sha256-der" },
    "keyId": { "$ref": "#/$defs/keyId" },
    "signature": { "type": "string", "minLength": 1, "contentEncoding": "base64" }
  },
  "$defs": {
    "sha256": { "type": "string", "pattern": "^[0-9a-f]{64}(?![\\s\\S])" },
    "keyId": { "type": "string", "pattern": "^sha256:[0-9a-f]{64}$" },
    "timestamp": { "type": "string", "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}Z$" }
  }
}
