{
    "$schema": "http://json-schema.org/draft-07/schema#",
    "$id": "http://rekor.sigstore.dev/types/intoto/intoto_v0_0_2_schema.json",
    "title": "intoto v0.0.2 Schema",
    "description": "Schema for intoto object",
    "type": "object",
    "properties": {
        "content": {
            "type": "object",
            "properties": {
                "envelope": {
                    "description": "dsse envelope",
                    "type": "object",
                    "properties": {
                        "payload": {
                            "description": "payload of the envelope",
                            "type": "string",
                            "format": "byte",
                            "writeOnly": true
                        },
                        "payloadType": {
                            "description": "type describing the payload",
                            "type": "string"
                        },
                        "signatures": {
                            "description": "collection of all signatures of the envelope's payload",
                            "type": "array",
                            "minItems": 1,
                            "items": {
                                "description": "a signature of the envelope's payload along with the public key for the signature",
                                "type": "object",
                                "properties": {
                                    "keyid": {
                                        "description": "optional id of the key used to create the signature",
                                        "type": "string"
                                    },
                                    "sig": {
                                        "description": "signature of the payload",
                                        "type": "string",
                                        "format": "byte"
                                    },
                                    "publicKey": {
                                        "description": "public key that corresponds to this signature",
                                        "type": "string",
                                        "format": "byte"
                                    }
                                },
                                "required": ["sig", "publicKey"]
                            }
                        }
                    },
                    "required": ["payloadType", "signatures"]
                },
                "hash": {
                    "description": "Specifies the hash algorithm and value encompassing the entire signed envelope",
                    "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 archive",
                            "type": "string"
                        }
                    },
                    "required": [
                        "algorithm",
                        "value"
                    ],
                    "readOnly": true
                },
                "payloadHash": {
                    "description": "Specifies the hash algorithm and value covering the payload within the DSSE envelope",
                    "type": "object",
                    "properties": {
                        "algorithm": {
                            "description": "The hashing function used to compute the hash value",
                            "type": "string",
                            "enum": [ "sha256" ]
                        },
                        "value": {
                            "description": "The hash value of the payload",
                            "type": "string"
                        }
                    },
                    "required": [
                        "algorithm",
                        "value"
                    ],
                    "readOnly": true
                }
            },
            "required": [
                "envelope"
            ]
        }
    },
    "required": [
        "content"
    ]
}
