{
  "id": "https://letsencrypt.org/schema/01/signature#",
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "Schema for a signature (alg RS256/e=65537 or P-256 ONLY)",
  "type": "object",
  "required": [
    "alg",
    "nonce",
    "sig",
    "jwk"
  ],
  "anyOf": [
    {
      "properties": {
        "alg": {
          "enum": [
            "RS256"
          ]
        },
        "nonce": {
          "type": "string"
        },
        "sig": {
          "type": "string",
          "pattern": "^[-_=0-9A-Za-z]+$"
        },
        "jwk": {
          "type": "object",
          "required": [
            "kty",
            "e",
            "n"
          ],
          "properties": {
            "kty": {
              "enum": [
                "RSA"
              ]
            },
            "e": {
              "enum": [
                "AQAB"
              ]
            },
            "n": {
              "type": "string",
              "pattern": "^[-_=0-9A-Za-z]+$"
            }
          }
        }
      }
    },
    {
      "properties": {
        "alg": {
          "enum": [
            "ES256"
          ]
        },
        "nonce": {
          "type": "string"
        },
        "sig": {
          "type": "string",
          "pattern": "^[-_=0-9A-Za-z]+$"
        },
        "jwk": {
          "type": "object",
          "required": [
            "kty",
            "crv",
            "x",
            "y"
          ],
          "properties": {
            "kty": {
              "enum": [
                "EC"
              ]
            },
            "crv": {
              "enum": [
                "P-256"
              ]
            },
            "x": {
              "type": "string",
              "pattern": "^[-_=0-9A-Za-z]+$"
            },
            "y": {
              "type": "string",
              "pattern": "^[-_=0-9A-Za-z]+$"
            }
          }
        }
      }
    }
  ]
}