{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "title": "SecJSON",
    "type": "object",
    "properties": {
        "EncryptedData": {
            "type": "object",
            "properties": {
                "EncryptionMethod": {
                    "$ref": "#/definitions/EncryptionMethod"
                },
                "KeyInfo": {
                    "$ref": "#/definitions/KeyInfo"
                },
                "CipherData": {
                    "$ref": "#/definitions/CipherData"
                }
            },
            "required": [
                "EncryptionMethod",
                "KeyInfo",
                "CipherData"
            ],
            "additionalProperties": false
        }
    },
    "required": [
        "EncryptedData"
    ],
    "additionalProperties": false,
    "definitions": {
        "EncryptionMethod": {
            "title": "EncryptionMethod",
            "type": "object",
            "properties": {
                "Algorithm": {
                    "type": "string"
                },
                "KeySize": {
                    "type": "integer"
                },
                "OAEPparams": {
                    "type": "string"
                }
            },
            "required": [
                "Algorithm"
            ]
        },
        "KeyInfo": {
            "title": "KeyInfo",
            "type": "object",
            "oneOf": [
                {
                    "type": "object",
                    "properties": {
                        "EncryptedKey": {
                            "$ref": "#/definitions/EncryptedKey"
                        }
                    },
                    "required": [
                        "EncryptedKey"
                    ]
                },
                {
                    "type": "object",
                    "properties": {
                        "RetrievalMethod": {
                            "$ref": "#/definitions/RetrievalMethod"
                        }
                    },
                    "required": [
                        "RetrievalMethod"
                    ]
                }
            ]
        },
        "CipherData": {
            "title": "CipherData",
            "type": "object",
            "oneOf": [
                {
                    "type": "object",
                    "properties": {
                        "CipherValue": {
                            "$ref": "#/definitions/CipherValue"
                        }
                    },
                    "required": [
                        "CipherValue"
                    ]
                },
                {
                    "type": "object",
                    "properties": {
                        "CipherReference": {
                            "$ref": "#/definitions/CipherReference"
                        }
                    },
                    "required": [
                        "CipherReference"
                    ]
                }
            ]
        },
        "EncryptedKey": {
            "title": "EncryptedKey",
            "type": "object",
            "properties ": {
                "EncryptionMethod": {
                    "$ref": "#/definitions/EncryptionMethod"
                },
                "KeyInfo": {
                    "$ref": "#/definitions/KeyInfo"
                },
                "CipherData": {
                    "$ref": "#/definitions/CipherData"
                }
            },
            "required": [
                "EncryptionMethod",
                "KeyInfo",
                "CipherData"
            ]
        },
        "RetrievalMethod": {
            "type": "string"
        },
        "CipherReference": {
            "title": "CipherReference",
            "type": "object",
            "properties": {
                "URI": {
                    "type": "string"
                },
                "Transforms": {
                    "type": "object",
                    "properties": {
                        "Transform": {
                            "type": "object",
                            "properties": {
                                "Algorithm": {
                                    "type": "string"
                                }
                            },
                            "required": [
                                "Algorithm"
                            ]
                        },
                        "Algorithm": {
                            "type": "string"
                        }
                    },
                    "required": [
                        "Algorithm"
                    ]
                }
            },
            "required": [
                "URI"
            ]
        },
        "CipherValue": {
            "properties": {
                "CipherValue": {
                    "type": "string"
                }
            }
        }
    }
}