{
  "openapi": "3.0.1",
  "info": {
    "title": "OpenAPI definition",
    "version": "v0"
  },
  "servers": [
    {
      "url": "",
      "description": "current server"
    }
  ],
  "tags": [
    {
      "name": "Pkcs12",
      "description": "Методы для работы с Pkcs12"
    },
    {
      "name": "CMS",
      "description": "Методы для работы с CMS"
    },
    {
      "name": "PDF",
      "description": "Методы для работы с PDF"
    },
    {
      "name": "WSSE",
      "description": "Методы для работы с WSSE"
    },
    {
      "name": "X509",
      "description": "Методы для работы с x509"
    },
    {
      "name": "XML",
      "description": "Методы для работы с XML"
    },
    {
      "name": "Actuator",
      "description": "Monitor and interact",
      "externalDocs": {
        "description": "Spring Boot Actuator Web API Documentation",
        "url": "https://docs.spring.io/spring-boot/docs/current/actuator-api/html/"
      }
    }
  ],
  "paths": {
    "/xml/verify": {
      "post": {
        "tags": [
          "XML"
        ],
        "operationId": "verify",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/XmlVerifyRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/VerificationResponse"
                }
              }
            }
          }
        }
      }
    },
    "/xml/sign": {
      "post": {
        "tags": [
          "XML"
        ],
        "operationId": "sign",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/XmlSignRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/XmlSignResponse"
                }
              }
            }
          }
        }
      }
    },
    "/x509/verify": {
      "post": {
        "tags": [
          "X509"
        ],
        "operationId": "verify_1",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SbaVerifyRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/VerificationResponse"
                }
              }
            }
          }
        }
      }
    },
    "/x509/info": {
      "post": {
        "tags": [
          "X509"
        ],
        "operationId": "verify_2",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/X509InfoRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/VerificationResponse"
                }
              }
            }
          }
        }
      }
    },
    "/wsse/verify": {
      "post": {
        "tags": [
          "WSSE"
        ],
        "operationId": "verify_3",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/XmlVerifyRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/VerificationResponse"
                }
              }
            }
          }
        }
      }
    },
    "/wsse/sign": {
      "post": {
        "tags": [
          "WSSE"
        ],
        "operationId": "sign_1",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WsseSignRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/XmlSignResponse"
                }
              }
            }
          }
        }
      }
    },
    "/pkcs12/info": {
      "post": {
        "tags": [
          "Pkcs12"
        ],
        "operationId": "info",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Pkcs12InfoRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/VerificationResponse"
                }
              }
            }
          }
        }
      }
    },
    "/pkcs12/aliases": {
      "post": {
        "tags": [
          "Pkcs12"
        ],
        "operationId": "aliases",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Pkcs12InfoRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/Pkcs12AliasesResponse"
                }
              }
            }
          }
        }
      }
    },
    "/pdf/verify": {
      "post": {
        "tags": [
          "PDF"
        ],
        "operationId": "verify_4",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PdfVerifyRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/PdfVerificationResponse"
                }
              }
            }
          }
        }
      }
    },
    "/pdf/sign": {
      "post": {
        "tags": [
          "PDF"
        ],
        "operationId": "sign_2",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PdfSignRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/PdfSignResponse"
                }
              }
            }
          }
        }
      }
    },
    "/cms/verify": {
      "post": {
        "tags": [
          "CMS"
        ],
        "operationId": "verify_5",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CmsVerifyRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/CmsVerificationResponse"
                }
              }
            }
          }
        }
      }
    },
    "/cms/sign": {
      "post": {
        "tags": [
          "CMS"
        ],
        "operationId": "sign_3",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CmsCreateRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/CmsResponse"
                }
              }
            }
          }
        }
      }
    },
    "/cms/sign/add": {
      "post": {
        "tags": [
          "CMS"
        ],
        "operationId": "signAdd",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CmsCreateRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/CmsResponse"
                }
              }
            }
          }
        }
      }
    },
    "/cms/extract": {
      "post": {
        "tags": [
          "CMS"
        ],
        "operationId": "extract",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CmsVerifyRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/CmsDataResponse"
                }
              }
            }
          }
        }
      }
    },
    "/actuator": {
      "get": {
        "tags": [
          "Actuator"
        ],
        "summary": "Actuator root web endpoint",
        "operationId": "links",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/vnd.spring-boot.actuator.v3+json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": {
                    "type": "object",
                    "additionalProperties": {
                      "$ref": "#/components/schemas/Link"
                    }
                  }
                }
              },
              "application/vnd.spring-boot.actuator.v2+json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": {
                    "type": "object",
                    "additionalProperties": {
                      "$ref": "#/components/schemas/Link"
                    }
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": {
                    "type": "object",
                    "additionalProperties": {
                      "$ref": "#/components/schemas/Link"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/actuator/health": {
      "get": {
        "tags": [
          "Actuator"
        ],
        "summary": "Actuator web endpoint 'health'",
        "operationId": "health",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/vnd.spring-boot.actuator.v3+json": {
                "schema": {
                  "type": "object"
                }
              },
              "application/vnd.spring-boot.actuator.v2+json": {
                "schema": {
                  "type": "object"
                }
              },
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/actuator/health/**": {
      "get": {
        "tags": [
          "Actuator"
        ],
        "summary": "Actuator web endpoint 'health-path'",
        "operationId": "health-path",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/vnd.spring-boot.actuator.v3+json": {
                "schema": {
                  "type": "object"
                }
              },
              "application/vnd.spring-boot.actuator.v2+json": {
                "schema": {
                  "type": "object"
                }
              },
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "XmlVerifyRequest": {
        "required": [
          "xml"
        ],
        "type": "object",
        "properties": {
          "revocationCheck": {
            "uniqueItems": true,
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "OCSP",
                "CRL"
              ]
            }
          },
          "xml": {
            "type": "string"
          }
        }
      },
      "CertificateInfo": {
        "type": "object",
        "properties": {
          "valid": {
            "type": "boolean"
          },
          "revocations": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CertificateRevocationStatus"
            }
          },
          "notBefore": {
            "type": "string",
            "format": "date-time"
          },
          "notAfter": {
            "type": "string",
            "format": "date-time"
          },
          "keyUsage": {
            "type": "string",
            "enum": [
              "UNKNOWN",
              "AUTH",
              "SIGN"
            ]
          },
          "serialNumber": {
            "type": "string"
          },
          "signAlg": {
            "type": "string"
          },
          "keyUser": {
            "uniqueItems": true,
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "INDIVIDUAL",
                "ORGANIZATION",
                "CEO",
                "CAN_SIGN",
                "CAN_SIGN_FINANCIAL",
                "HR",
                "EMPLOYEE",
                "NCA_PRIVILEGES",
                "NCA_ADMIN",
                "NCA_MANAGER",
                "NCA_OPERATOR",
                "IDENTIFICATION",
                "IDENTIFICATION_CON",
                "IDENTIFICATION_REMOTE",
                "IDENTIFICATION_REMOTE_DIGITAL_ID"
              ]
            }
          },
          "publicKey": {
            "type": "string"
          },
          "signature": {
            "type": "string"
          },
          "subject": {
            "$ref": "#/components/schemas/CertificateSubject"
          },
          "issuer": {
            "$ref": "#/components/schemas/CertificateSubject"
          }
        }
      },
      "CertificateRevocationStatus": {
        "type": "object",
        "properties": {
          "revoked": {
            "type": "boolean"
          },
          "by": {
            "type": "string",
            "enum": [
              "OCSP",
              "CRL"
            ]
          },
          "revocationTime": {
            "type": "string",
            "format": "date-time"
          },
          "reason": {
            "type": "string"
          }
        }
      },
      "CertificateSubject": {
        "type": "object",
        "properties": {
          "commonName": {
            "type": "string"
          },
          "lastName": {
            "type": "string"
          },
          "surName": {
            "type": "string"
          },
          "email": {
            "type": "string"
          },
          "organization": {
            "type": "string"
          },
          "gender": {
            "type": "string",
            "enum": [
              "NONE",
              "MALE",
              "FEMALE"
            ]
          },
          "iin": {
            "type": "string"
          },
          "bin": {
            "type": "string"
          },
          "country": {
            "type": "string"
          },
          "locality": {
            "type": "string"
          },
          "state": {
            "type": "string"
          },
          "dn": {
            "type": "string"
          }
        }
      },
      "VerificationResponse": {
        "type": "object",
        "properties": {
          "status": {
            "type": "integer",
            "format": "int32"
          },
          "message": {
            "type": "string"
          },
          "valid": {
            "type": "boolean"
          },
          "signers": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CertificateInfo"
            }
          }
        }
      },
      "SignerRequest": {
        "required": [
          "key",
          "password"
        ],
        "type": "object",
        "properties": {
          "key": {
            "type": "string"
          },
          "password": {
            "type": "string"
          },
          "keyAlias": {
            "type": "string"
          },
          "referenceUri": {
            "type": "string"
          }
        }
      },
      "XmlSignRequest": {
        "required": [
          "signers",
          "xml"
        ],
        "type": "object",
        "properties": {
          "xml": {
            "type": "string"
          },
          "signers": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SignerRequest"
            }
          },
          "clearSignatures": {
            "type": "boolean"
          },
          "trimXml": {
            "type": "boolean"
          }
        }
      },
      "XmlSignResponse": {
        "type": "object",
        "properties": {
          "status": {
            "type": "integer",
            "format": "int32"
          },
          "message": {
            "type": "string"
          },
          "xml": {
            "type": "string"
          }
        }
      },
      "SbaVerifyRequest": {
        "required": [
          "certificate"
        ],
        "type": "object",
        "properties": {
          "revocationCheck": {
            "uniqueItems": true,
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "OCSP",
                "CRL"
              ]
            }
          },
          "certificate": {
            "type": "string"
          },
          "signature": {
            "type": "string"
          },
          "data": {
            "type": "string"
          }
        }
      },
      "X509InfoRequest": {
        "required": [
          "certs"
        ],
        "type": "object",
        "properties": {
          "revocationCheck": {
            "uniqueItems": true,
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "OCSP",
                "CRL"
              ]
            }
          },
          "certs": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "WsseSignRequest": {
        "required": [
          "key",
          "password",
          "xml"
        ],
        "type": "object",
        "properties": {
          "xml": {
            "type": "string"
          },
          "key": {
            "type": "string"
          },
          "password": {
            "type": "string"
          },
          "keyAlias": {
            "type": "string"
          },
          "trimXml": {
            "type": "boolean"
          }
        }
      },
      "Pkcs12InfoRequest": {
        "required": [
          "keys"
        ],
        "type": "object",
        "properties": {
          "revocationCheck": {
            "uniqueItems": true,
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "OCSP",
                "CRL"
              ]
            }
          },
          "keys": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SignerRequest"
            }
          }
        }
      },
      "Pkcs12AliasesResponse": {
        "type": "object",
        "properties": {
          "status": {
            "type": "integer",
            "format": "int32"
          },
          "message": {
            "type": "string"
          },
          "aliases": {
            "type": "array",
            "items": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          }
        }
      },
      "PdfVerifyRequest": {
        "required": [
          "pdf"
        ],
        "type": "object",
        "properties": {
          "revocationCheck": {
            "uniqueItems": true,
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "OCSP",
                "CRL"
              ]
            }
          },
          "pdf": {
            "type": "string"
          }
        }
      },
      "PdfSignerInfo": {
        "type": "object",
        "properties": {
          "valid": {
            "type": "boolean"
          },
          "reason": {
            "type": "string"
          },
          "location": {
            "type": "string"
          },
          "contactInfo": {
            "type": "string"
          },
          "signDate": {
            "type": "string",
            "format": "date-time"
          },
          "certificate": {
            "$ref": "#/components/schemas/CertificateInfo"
          },
          "signatureAlgorithm": {
            "type": "string"
          },
          "digestAlgorithm": {
            "type": "string"
          }
        }
      },
      "PdfVerificationResponse": {
        "type": "object",
        "properties": {
          "status": {
            "type": "integer",
            "format": "int32"
          },
          "message": {
            "type": "string"
          },
          "valid": {
            "type": "boolean"
          },
          "signers": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PdfSignerInfo"
            }
          }
        }
      },
      "PdfSignRequest": {
        "required": [
          "pdf",
          "signers"
        ],
        "type": "object",
        "properties": {
          "pdf": {
            "type": "string"
          },
          "signers": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PdfSigner"
            }
          },
          "withTsp": {
            "type": "boolean"
          },
          "tsaPolicy": {
            "type": "string",
            "enum": [
              "TSA_GOST2015_POLICY",
              "TSA_GOST_POLICY",
              "TSA_GOSTGT_POLICY"
            ]
          }
        }
      },
      "PdfSigner": {
        "required": [
          "signer"
        ],
        "type": "object",
        "properties": {
          "reason": {
            "type": "string"
          },
          "location": {
            "type": "string"
          },
          "contactInfo": {
            "type": "string"
          },
          "signer": {
            "$ref": "#/components/schemas/SignerRequest"
          }
        }
      },
      "PdfSignResponse": {
        "type": "object",
        "properties": {
          "status": {
            "type": "integer",
            "format": "int32"
          },
          "message": {
            "type": "string"
          },
          "pdf": {
            "type": "string"
          }
        }
      },
      "CmsVerifyRequest": {
        "required": [
          "cms"
        ],
        "type": "object",
        "properties": {
          "revocationCheck": {
            "uniqueItems": true,
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "OCSP",
                "CRL"
              ]
            }
          },
          "cms": {
            "type": "string"
          },
          "data": {
            "type": "string"
          }
        }
      },
      "CmsSignerInfo": {
        "type": "object",
        "properties": {
          "certificates": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CertificateInfo"
            }
          },
          "tsp": {
            "$ref": "#/components/schemas/TspInfo"
          }
        }
      },
      "CmsVerificationResponse": {
        "type": "object",
        "properties": {
          "status": {
            "type": "integer",
            "format": "int32"
          },
          "message": {
            "type": "string"
          },
          "valid": {
            "type": "boolean"
          },
          "signers": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CmsSignerInfo"
            }
          }
        }
      },
      "TspInfo": {
        "type": "object",
        "properties": {
          "serialNumber": {
            "type": "string"
          },
          "genTime": {
            "type": "string",
            "format": "date-time"
          },
          "policy": {
            "type": "string"
          },
          "tsa": {
            "type": "string"
          },
          "tspHashAlgorithm": {
            "type": "string"
          },
          "hash": {
            "type": "string"
          }
        }
      },
      "CmsCreateRequest": {
        "required": [
          "signers"
        ],
        "type": "object",
        "properties": {
          "cms": {
            "type": "string"
          },
          "data": {
            "type": "string"
          },
          "signers": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SignerRequest"
            }
          },
          "withTsp": {
            "type": "boolean"
          },
          "tsaPolicy": {
            "type": "string",
            "enum": [
              "TSA_GOST2015_POLICY",
              "TSA_GOST_POLICY",
              "TSA_GOSTGT_POLICY"
            ]
          },
          "detached": {
            "type": "boolean"
          }
        }
      },
      "CmsResponse": {
        "type": "object",
        "properties": {
          "status": {
            "type": "integer",
            "format": "int32"
          },
          "message": {
            "type": "string"
          },
          "cms": {
            "type": "string"
          }
        }
      },
      "CmsDataResponse": {
        "type": "object",
        "properties": {
          "status": {
            "type": "integer",
            "format": "int32"
          },
          "message": {
            "type": "string"
          },
          "data": {
            "type": "string"
          }
        }
      },
      "Link": {
        "type": "object",
        "properties": {
          "href": {
            "type": "string"
          },
          "templated": {
            "type": "boolean"
          }
        }
      }
    }
  }
}