{
    "$schema": "http://json-schema.org/draft-07/schema#",
    "$id": "http://rekor.sigstore.dev/types/rekord/rekord_v0_0_1_schema.json",
    "title": "Rekor v0.0.1 Schema",
    "description": "Schema for Rekord object",
    "type": "object",
    "properties": {
        "signature": {
            "description": "Information about the detached signature associated with the entry",
            "type": "object",
            "properties": {
                "format": {
                    "description": "Specifies the format of the signature",
                    "type": "string",
                    "enum": [ "pgp", "minisign", "x509", "ssh" ]
                },
                "content": {
                    "description": "Specifies the content of the signature inline within the document",
                    "type": "string",
                    "format": "byte"
                },
                "publicKey" : {
                    "description": "The public key that can verify the signature",
                    "type": "object",
                    "properties": {
                        "content": {
                            "description": "Specifies the content of the public key inline within the document",
                            "type": "string",
                            "format": "byte"
                        }
                    },
                    "required": [ "content" ]
                }
            },
            "required": [ "format", "publicKey", "content" ]
        },
        "data": {
            "description": "Information about the content associated with the entry",
            "type": "object",
            "properties": {
                "hash": {
                    "description": "Specifies the hash algorithm and value for the content",
                    "type": "object",
                    "properties": {
                        "algorithm": {
                            "description": "The hashing function used to compute the hash value",
                            "type": "string",
                            "enum": [ "sha256" ]
                        },
                        "value": {
                            "description": "The hash value for the content",
                            "type": "string"
                        }
                    },
                    "required": [ "algorithm", "value" ],
                    "readOnly": true
                },
                "content": {
                    "description": "Specifies the content inline within the document",
                    "type": "string",
                    "format": "byte",
                    "writeOnly": true
                }
            },
            "oneOf": [
                {
                    "required": [ "hash" ]
                },
                {
                    "required": [ "content" ]
                }
            ]
        }
    },
    "required": [ "signature", "data" ]
}
