{
  "components": {
    "schemas": {
      "ConsistencyProofResponseDto": {
        "additionalProperties": false,
        "properties": {
          "newSize": {
            "format": "int64",
            "type": "integer"
          },
          "oldSize": {
            "format": "int64",
            "type": "integer"
          },
          "proofBase64Url": {
            "items": {
              "type": "string"
            },
            "nullable": true,
            "type": "array"
          },
          "treeHead": {
            "$ref": "#/components/schemas/SignedTreeHeadDto"
          }
        },
        "type": "object"
      },
      "ProblemDetails": {
        "additionalProperties": {},
        "properties": {
          "detail": {
            "nullable": true,
            "type": "string"
          },
          "instance": {
            "nullable": true,
            "type": "string"
          },
          "status": {
            "format": "int32",
            "nullable": true,
            "type": "integer"
          },
          "title": {
            "nullable": true,
            "type": "string"
          },
          "type": {
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "PublicKeyResponseDto": {
        "additionalProperties": false,
        "properties": {
          "inclusionProofBase64Url": {
            "items": {
              "type": "string"
            },
            "nullable": true,
            "type": "array"
          },
          "keyEpoch": {
            "format": "int32",
            "type": "integer"
          },
          "keyType": {
            "nullable": true,
            "type": "string"
          },
          "principalId": {
            "format": "uuid",
            "type": "string"
          },
          "principalType": {
            "nullable": true,
            "type": "string"
          },
          "publicKeyBase64Url": {
            "nullable": true,
            "type": "string"
          },
          "scopeId": {
            "format": "uuid",
            "type": "string"
          },
          "sequenceNumber": {
            "format": "int64",
            "type": "integer"
          },
          "treeHead": {
            "$ref": "#/components/schemas/SignedTreeHeadDto"
          }
        },
        "type": "object"
      },
      "PublishKeyRequestDto": {
        "additionalProperties": false,
        "properties": {
          "keyEpoch": {
            "format": "int32",
            "type": "integer"
          },
          "keyType": {
            "nullable": true,
            "type": "string"
          },
          "principalId": {
            "format": "uuid",
            "type": "string"
          },
          "principalType": {
            "nullable": true,
            "type": "string"
          },
          "publicKeyBase64Url": {
            "nullable": true,
            "type": "string"
          },
          "scopeId": {
            "format": "uuid",
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "PublishKeyResponseDto": {
        "additionalProperties": false,
        "properties": {
          "sequenceNumber": {
            "format": "int64",
            "type": "integer"
          },
          "treeHead": {
            "$ref": "#/components/schemas/SignedTreeHeadDto"
          }
        },
        "type": "object"
      },
      "SignedTreeHeadDto": {
        "additionalProperties": false,
        "properties": {
          "rootHashBase64Url": {
            "nullable": true,
            "type": "string"
          },
          "signatureBase64Url": {
            "nullable": true,
            "type": "string"
          },
          "timestampMs": {
            "format": "int64",
            "type": "integer"
          },
          "treeSize": {
            "format": "int64",
            "type": "integer"
          }
        },
        "type": "object"
      }
    }
  },
  "info": {
    "title": "Essence.Directory.PublicKey.Api",
    "version": "1.0"
  },
  "openapi": "3.0.1",
  "paths": {
    "/api/v1/encryption/consistency-proof": {
      "get": {
        "parameters": [
          {
            "in": "query",
            "name": "oldSize",
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConsistencyProofResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConsistencyProofResponseDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ConsistencyProofResponseDto"
                }
              }
            },
            "description": "Success"
          }
        },
        "tags": [
          "PublicKeys"
        ]
      }
    },
    "/api/v1/encryption/log-key": {
      "get": {
        "responses": {
          "200": {
            "description": "Success"
          }
        },
        "tags": [
          "PublicKeys"
        ]
      }
    },
    "/api/v1/encryption/public-key": {
      "post": {
        "requestBody": {
          "content": {
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/PublishKeyRequestDto"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PublishKeyRequestDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/PublishKeyRequestDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublishKeyResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublishKeyResponseDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PublishKeyResponseDto"
                }
              }
            },
            "description": "Success"
          }
        },
        "tags": [
          "PublicKeys"
        ]
      }
    },
    "/api/v1/encryption/public-key/{principalId}": {
      "get": {
        "parameters": [
          {
            "in": "path",
            "name": "principalId",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "keyType",
            "schema": {
              "default": "UserSharing",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "principalType",
            "schema": {
              "default": "User",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "scopeId",
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicKeyResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicKeyResponseDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PublicKeyResponseDto"
                }
              }
            },
            "description": "Success"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            },
            "description": "Not Found"
          }
        },
        "tags": [
          "PublicKeys"
        ]
      }
    },
    "/api/v1/encryption/tree-head": {
      "get": {
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SignedTreeHeadDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/SignedTreeHeadDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/SignedTreeHeadDto"
                }
              }
            },
            "description": "Success"
          }
        },
        "tags": [
          "PublicKeys"
        ]
      }
    }
  }
}
