{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://directdemocracy.vote/json-schema/2/certificate.schema.json",
  "title": "certificate",
  "description": "certificate of a participant with respect to a publication",
  "type": "object",
  "required": [
    "schema",
    "key",
    "signature",
    "published",
    "type",
    "publication"
  ],
  "properties": {
    "schema": {
      "const": "https://directdemocracy.vote/json-schema/2/certificate.schema.json"
    },
    "key": {
      "description": "public key of the participant",
      "type": "string",
      "maxLength": 512
    },
    "signature": {
      "description": "signature of the participant",
      "type": "string",
      "maxLength": 512
    },
    "published": {
      "description": "date of publication (seconds since 1970-01-01 00:00:00)",
      "type": "integer",
      "minimum": 0,
      "maximum": 999999999999
    },
    "appKey": {
      "description": "public key of the app used by the participant",
      "type": "string",
      "maxLength": 512
    },
    "appSignature": {
      "description": "signature of the app",
      "type": "string",
      "maxLength": 512
    },
    "type": {
      "enum": ["endorse", "report", "sign", "trust", "distrust"]
    },
    "publication": {
      "description": "signature of the publication which the participant certifies",
      "type": "string",
      "maxLength": 512
    },
    "comment": {
      "description": "public comment",
      "type": "string"
    },
    "message": {
      "description": "message encrypted with the public key of the author of the publication",
      "type": "string"
    }
  },
  "additionalProperties": false
}
