{
  "type": "object",
  "properties": {
    "algorithm": {
      "type": "string",
      "enum": [
        "SHA-256",
        "SHA-384",
        "SHA-512"
      ]
    },
    "value": {
      "type": "string",
      "pattern": "^[a-fA-F0-9]+$"
    }
  },
  "required": [
    "algorithm",
    "value"
  ],
  "additionalProperties": false,
  "allOf": [
    {
      "if": {
        "properties": {
          "algorithm": {
            "const": "SHA-256"
          }
        },
        "required": [
          "algorithm"
        ]
      },
      "then": {
        "properties": {
          "value": {
            "minLength": 64,
            "maxLength": 64
          }
        }
      }
    },
    {
      "if": {
        "properties": {
          "algorithm": {
            "const": "SHA-384"
          }
        },
        "required": [
          "algorithm"
        ]
      },
      "then": {
        "properties": {
          "value": {
            "minLength": 96,
            "maxLength": 96
          }
        }
      }
    },
    {
      "if": {
        "properties": {
          "algorithm": {
            "const": "SHA-512"
          }
        },
        "required": [
          "algorithm"
        ]
      },
      "then": {
        "properties": {
          "value": {
            "minLength": 128,
            "maxLength": 128
          }
        }
      }
    }
  ],
  "examples": [
    {
      "algorithm": "SHA-256",
      "value": "0000000000000000000000000000000000000000000000000000000000000000"
    }
  ]
}
