{
  "openapi": "3.0.3",
  "info": {
    "title": "Ключник ГОСТ",
    "description": "Сетевой криптографический сервис предоставляющий следующие возможности:\n- цифровая подпись бинарных и текстовых данных\n- проверка цифровой подписи данных\n- вычисление хэш разными алгоритмами\n- получение информации о сертификатах\n- подписание XML с учетом специфики СМЭВ",
    "version": "3.3.0"
  },
  "externalDocs": {
    "description": "Подробнее о Ключник ГОСТ",
    "url": "https://docs.kgost.ru"
  },
  "servers": [
    {
      "url": "https://omnibox.kgost.ru"
    }
  ],
  "tags": [
    {
      "name": "v3/key_containers",
      "description": "Работа с ключевыми контейнерами"
    },
    {
      "name": "v3/cert",
      "description": "Сертификаты"
    },
    {
      "name": "v3/digest",
      "description": "Вычисление ХЭШ"
    },
    {
      "name": "v3/raw_sign",
      "description": "Сырая подпись данных"
    },
    {
      "name": "v3/raw_sign_hash",
      "description": "Сырая подпись ХЭШ"
    },
    {
      "name": "v3/cms_sign",
      "description": "CMS (SMIME) подпись данных"
    },
    {
      "name": "v3/xml_sign",
      "description": "Подпись XML документа"
    },
    {
      "name": "other",
      "description": "Разное"
    }
  ],
  "paths": {
    "/v3/key_containers": {
      "get": {
        "tags": [
          "v3/key_containers"
        ],
        "security": [
          {
            "BasicAuth": []
          },
          {
            "OAuth2": []
          }
        ],
        "summary": "Получение списка загруженных крипто-контейнеров",
        "parameters": [
          {
            "in": "query",
            "name": "from",
            "description": "Начать с записи с указанным последовательным номером",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "example": 0
          },
          {
            "in": "query",
            "name": "limit",
            "description": "Ограничить выборку указанным количеством записей",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "example": 10
          }
        ],
        "responses": {
          "200": {
            "description": "Список загруженных крипто-контейнеров",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/PaginatedResponse"
                    },
                    {
                      "type": "object",
                      "required": [
                        "items"
                      ],
                      "properties": {
                        "items": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/KeyContainer"
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "v3/key_containers"
        ],
        "security": [
          {
            "BasicAuth": []
          },
          {
            "OAuth2": []
          }
        ],
        "summary": "Загрузка крипто-контейнера из файла",
        "description": "Для OpenSSL поддерживаются форматы сертификата и ключа `PEM` и `DER`. \n\nДля КриптоПро CSP поддерживается формат контейнеров КриптоПРО (6 файлов). \n\nТак же поддерживается загрузка ZIP архива с файлами.\n",
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "required": [
                  "files"
                ],
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "Имя контейнера",
                    "example": ""
                  },
                  "alias": {
                    "type": "string",
                    "description": "Дополнительное имя контейнера",
                    "example": ""
                  },
                  "pin": {
                    "type": "string",
                    "description": "PIN код контейнера\n",
                    "example": ""
                  },
                  "files": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "format": "binary"
                    },
                    "example": []
                  },
                  "two_factor_mode": {
                    "type": "string",
                    "description": "Режим использования двухфакторного подтверждения\n- `DEFAULT` - Использовать согласно настройкам системы\n- `ENABLED` - Использовать\n- `DISABLED` - Не использовать\n",
                    "enum": [
                      "DEFAULT",
                      "ENABLED",
                      "DISABLED"
                    ],
                    "example": ""
                  }
                }
              },
              "encoding": {
                "meta": {
                  "contentType": "application/json"
                },
                "file": {
                  "contentType": "application/zip, application/x-pem-file, application/pkix-cert, application/x-pkcs12"
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Результат загрузки с ID нового контейнера",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KeyContainerUploadResult"
                }
              }
            }
          }
        }
      }
    },
    "/v3/key_containers/{id}": {
      "get": {
        "tags": [
          "v3/key_containers"
        ],
        "security": [
          {
            "BasicAuth": []
          },
          {
            "OAuth2": []
          }
        ],
        "summary": "Получение контейнера по ID",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "description": "Идентификатор контейнера",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Информация о контейнере",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KeyContainer"
                }
              }
            }
          },
          "404": {
            "description": "Контейнер не найден по ID",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "patch": {
        "tags": [
          "v3/key_containers"
        ],
        "security": [
          {
            "BasicAuth": []
          },
          {
            "OAuth2": []
          }
        ],
        "summary": "Обновление контейнера",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "description": "Идентификатор обновляемого контейнера",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/KeyContainerUpdateRequest"
              },
              "encoding": {
                "meta": {
                  "contentType": "application/json"
                }
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/KeyContainerUpdateRequest"
              },
              "encoding": {
                "meta": {
                  "contentType": "application/json"
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Обновлено успешно"
          }
        }
      },
      "delete": {
        "tags": [
          "v3/key_containers"
        ],
        "security": [
          {
            "BasicAuth": []
          },
          {
            "OAuth2": []
          }
        ],
        "summary": "Удаление контейнера",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "description": "Идентификатор удаляемого контейнера",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Удалено успешно"
          }
        }
      }
    },
    "/v3/digest/calc": {
      "post": {
        "tags": [
          "v3/digest"
        ],
        "summary": "Вычисление хэш",
        "description": "Вычисление хэш",
        "parameters": [
          {
            "in": "query",
            "name": "algorithm",
            "description": "Алгоритм вычисления хэша",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "GOST_3411_2012_256",
                "GOST_3411_2012_512",
                "SHA1"
              ]
            },
            "example": "GOST_3411_2012_256"
          }
        ],
        "requestBody": {
          "description": "Данные для вычисления хэша",
          "required": true,
          "content": {
            "application/octet-stream": {
              "schema": {
                "type": "string",
                "format": "binary"
              }
            },
            "plain/text": {
              "schema": {
                "type": "string",
                "example": "Тестовые данные"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Результат вычисления хэша",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HashResult"
                }
              }
            }
          },
          "500": {
            "description": "Внутренняя ошибка",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "BasicAuth": []
          },
          {
            "OAuth2": []
          }
        ]
      }
    },
    "/v3/raw_sign/sign": {
      "post": {
        "tags": [
          "v3/raw_sign"
        ],
        "summary": "Вычисление RAW подписи",
        "description": "Вычисление RAW подписи",
        "parameters": [
          {
            "in": "query",
            "name": "cert",
            "description": "Имя сертификата или alias",
            "required": true,
            "example": "test_gost12_256",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "Данные для вычисления подписи",
          "required": true,
          "content": {
            "application/octet-stream": {
              "schema": {
                "type": "string",
                "format": "binary"
              }
            },
            "plain/text": {
              "schema": {
                "type": "string",
                "example": "Тестовые данные для подписи"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Вычисленная подпись",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Signature"
                }
              }
            }
          },
          "404": {
            "description": "Приватный ключ для подписи не найден",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Внутренняя ошибка",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "BasicAuth": []
          },
          {
            "OAuth2": []
          }
        ]
      }
    },
    "/v3/raw_sign/verify": {
      "post": {
        "tags": [
          "v3/raw_sign"
        ],
        "summary": "Проверка RAW подписи",
        "description": "Проверка RAW подписи",
        "parameters": [
          {
            "in": "query",
            "name": "cert",
            "description": "Имя сертификата или alias",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "test_gost12_256"
          },
          {
            "in": "query",
            "name": "signature",
            "description": "Подпись, закодированная в base64",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "Данные для проверки подписи",
          "required": true,
          "content": {
            "application/octet-stream": {
              "schema": {
                "type": "string",
                "format": "binary"
              }
            },
            "plain/text": {
              "schema": {
                "type": "string",
                "example": "Тестовые данные для подписи"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Результат верификации",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SignatureVerificationResult"
                }
              }
            }
          },
          "404": {
            "description": "Публичный ключ не найден",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Внутренняя ошибка",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "BasicAuth": []
          },
          {
            "OAuth2": []
          }
        ]
      }
    },
    "/v3/raw_sign_hash/sign": {
      "post": {
        "tags": [
          "v3/raw_sign_hash"
        ],
        "summary": "Вычисление RAW подписи ХЭШ",
        "description": "Вычисление RAW подписи ХЭШ",
        "parameters": [
          {
            "in": "query",
            "name": "cert",
            "description": "Имя сертификата или alias",
            "required": true,
            "example": "test_gost12_256",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "hash",
            "description": "Значение ХЭШ в закодированное в base64",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Вычисленная подпись",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Signature"
                }
              }
            }
          },
          "404": {
            "description": "Приватный ключ для подписи не найден",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Внутренняя ошибка",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "BasicAuth": []
          },
          {
            "OAuth2": []
          }
        ]
      }
    },
    "/v3/raw_sign_hash/verify": {
      "post": {
        "tags": [
          "v3/raw_sign_hash"
        ],
        "summary": "Проверка RAW подписи ХЭШ",
        "description": "Проверка RAW подписи ХЭШ",
        "parameters": [
          {
            "in": "query",
            "name": "cert",
            "description": "Имя сертификата или alias",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "test_gost12_256"
          },
          {
            "in": "query",
            "name": "signature",
            "description": "Подпись, закодированная в base64",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "hash",
            "description": "Значение ХЭШ, закодированное в base64",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Результат верификации",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SignatureVerificationResult"
                }
              }
            }
          },
          "404": {
            "description": "Публичный ключ не найден",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Внутренняя ошибка",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "BasicAuth": []
          },
          {
            "OAuth2": []
          }
        ]
      }
    },
    "/v3/cms_sign/sign": {
      "post": {
        "tags": [
          "v3/cms_sign"
        ],
        "summary": "Вычисление CMS (SMIME) подписи",
        "description": "Вычисление CMS (SMIME) подписи",
        "parameters": [
          {
            "in": "query",
            "name": "cert",
            "description": "Имя сертификата или alias",
            "required": true,
            "example": "test_gost12_256",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "Данные для вычисления подписи",
          "required": true,
          "content": {
            "application/octet-stream": {
              "schema": {
                "type": "string",
                "format": "binary"
              }
            },
            "plain/text": {
              "schema": {
                "type": "string",
                "example": "Тестовые данные для подписи"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Вычисленная подпись",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Signature"
                }
              }
            }
          },
          "404": {
            "description": "Приватный ключ для подписи не найден",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Внутренняя ошибка",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "BasicAuth": []
          },
          {
            "OAuth2": []
          }
        ]
      }
    },
    "/v3/cms_sign/verify": {
      "post": {
        "tags": [
          "v3/cms_sign"
        ],
        "summary": "Проверка CMS (SMIME) подписи",
        "description": "Проверка CMS (SMIME) подписи",
        "parameters": [
          {
            "in": "query",
            "name": "cert",
            "description": "Имя сертификата или alias",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "test_gost12_256"
          },
          {
            "in": "query",
            "name": "signature",
            "description": "Подпись, закодированная в base64",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "Данные для проверки подписи",
          "required": true,
          "content": {
            "application/octet-stream": {
              "schema": {
                "type": "string",
                "format": "binary"
              }
            },
            "plain/text": {
              "schema": {
                "type": "string",
                "example": "Тестовые данные для подписи"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Результат верификации",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SignatureVerificationResult"
                }
              }
            }
          },
          "404": {
            "description": "Публичный ключ не найден",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Внутренняя ошибка",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "BasicAuth": []
          },
          {
            "OAuth2": []
          }
        ]
      }
    },
    "/v3/xml_sign/sign": {
      "post": {
        "tags": [
          "v3/xml_sign"
        ],
        "summary": "Подписание XML документа (XMLDSig) с учетом СМЭВ специфики",
        "description": "Подписание XML документа (XMLDSig) с учетом СМЭВ специфики",
        "parameters": [
          {
            "in": "query",
            "name": "cert",
            "description": "Имя сертификата или alias",
            "required": true,
            "example": "test_gost12_256",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "algorithm",
            "description": "Алгоритм подписи:\n  * `XML_DSIG` - стандартный режим подписи\n  * `XML_DSIG_SMEV` - с добавлением СМЕВ трансформации\n",
            "required": true,
            "example": "XML_DSIG_SMEV",
            "schema": {
              "type": "string",
              "enum": [
                "XML_DSIG_SMEV",
                "XML_DSIG"
              ]
            }
          },
          {
            "in": "query",
            "name": "target",
            "description": "Xpath элемента в который нужно положить подпись",
            "required": true,
            "example": "//*[local-name()=\"CallerInformationSystemSignature\"]",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "references",
            "description": "Подписываемый элемент",
            "required": true,
            "example": "#SIGNED_BY_CALLER",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "XML документ для подписания",
          "required": true,
          "content": {
            "application/xml": {
              "schema": {
                "type": "string"
              },
              "example": "<?xml version=\"1.0\" encoding=\"UTF-8\"?> <soap:Envelope xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:ns=\"urn://x-artefacts-smev-gov-ru/services/message-exchange/types/1.1\" xmlns:m0=\"urn://x-artefacts-smev-gov-ru/services/message-exchange/types/1.2\" xmlns:m1=\"urn://x-artefacts-smev-gov-ru/services/message-exchange/types/basic/1.2\"> <soap:Body> <m0:SendRequestRequest> <m0:SenderProvidedRequestData Id=\"SIGNED_BY_CALLER\"> <m0:MessageID>26272a94-3381-11ed-83f7-024233d28420</m0:MessageID> <m1:MessagePrimaryContent> <WorkFactRequest xmlns=\"http://kvs.pfr.com/work-fact/1.0.3\"> <Snils>99999999901</Snils> <StartPeriod>2016-04-01</StartPeriod> <EndPeriod>2016-05-31</EndPeriod> </WorkFactRequest> </m1:MessagePrimaryContent> <m0:TestMessage /> </m0:SenderProvidedRequestData> <m0:CallerInformationSystemSignature> </m0:CallerInformationSystemSignature> </m0:SendRequestRequest> </soap:Body> </soap:Envelope>"
            }
          }
        },
        "responses": {
          "200": {
            "description": "Подписанный конверт",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V3XmlDSigResult"
                }
              }
            }
          }
        },
        "security": [
          {
            "BasicAuth": []
          },
          {
            "OAuth2": []
          }
        ]
      }
    },
    "/v3/xml_sign/verify": {
      "post": {
        "tags": [
          "v3/xml_sign"
        ],
        "summary": "Проверка подписи XML документа (XMLDSig) с учетом СМЭВ специфики",
        "description": "Проверка подписи XML документа (XMLDSig) с учетом СМЭВ специфики",
        "parameters": [
          {
            "in": "query",
            "name": "cert",
            "description": "Имя сертификата или alias",
            "required": true,
            "example": "test_gost12_256",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "Подписанный XML документ для проверки",
          "required": true,
          "content": {
            "application/xml": {
              "schema": {
                "type": "string"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Результат верификации",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SignatureVerificationResult"
                }
              }
            }
          }
        },
        "security": [
          {
            "BasicAuth": []
          },
          {
            "OAuth2": []
          }
        ]
      }
    },
    "/v3/cert/info": {
      "get": {
        "tags": [
          "v3/cert"
        ],
        "summary": "Получение информации о сертификате",
        "description": "Получение информации сертификате",
        "parameters": [
          {
            "in": "query",
            "name": "cert",
            "description": "Имя сертификата или alias",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "test_gost12_256"
          }
        ],
        "responses": {
          "200": {
            "description": "Тело сертификата",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CertResult"
                }
              }
            }
          },
          "404": {
            "description": "Сертификат не найден",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Внутренняя ошибка",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "BasicAuth": []
          },
          {
            "OAuth2": []
          }
        ]
      }
    },
    "/healthcheck": {
      "get": {
        "tags": [
          "other"
        ],
        "summary": "Проверка работоспособности сервиса",
        "description": "Проверка работоспособности сервиса",
        "responses": {
          "200": {
            "description": "Сервис в порядке"
          },
          "5XX": {
            "description": "Есть проблемы"
          }
        }
      }
    },
    "/metrics": {
      "get": {
        "tags": [
          "other"
        ],
        "summary": "Метрики Prometheus",
        "description": "Метрики Prometheus",
        "responses": {
          "200": {
            "description": "Метрики",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "V2XmlDSigResult": {
        "type": "object",
        "required": [
          "signed_content"
        ],
        "properties": {
          "signed_content": {
            "type": "string",
            "description": "Подписанный СМЭВ3 конверт"
          }
        }
      },
      "V3XmlDSigResult": {
        "type": "object",
        "required": [
          "signed_content"
        ],
        "properties": {
          "signed_content": {
            "type": "string",
            "description": "Подписанный СМЭВ3 конверт"
          }
        }
      },
      "HashResult": {
        "type": "object",
        "properties": {
          "digest": {
            "type": "string",
            "description": "Хэш, закодированный в base64"
          }
        }
      },
      "Signature": {
        "type": "object",
        "properties": {
          "signature": {
            "type": "string",
            "description": "Подпись, закодированная в base64"
          }
        }
      },
      "SignatureVerificationResult": {
        "type": "object",
        "properties": {
          "valid": {
            "type": "boolean",
            "description": "true, если подпись валидна"
          }
        }
      },
      "CertResult": {
        "type": "object",
        "properties": {
          "body": {
            "type": "string",
            "description": "Тело сертификата, закодированное в base64"
          },
          "serial": {
            "type": "string",
            "description": "Серийный номер сертификата в HEX"
          },
          "issuer": {
            "type": "string",
            "description": "Эмитент сертификата"
          },
          "subject": {
            "type": "string",
            "description": "Предмет сертификата"
          },
          "notBefore": {
            "type": "string",
            "format": "date-time",
            "description": "Время начала действия сертификата"
          },
          "notAfter": {
            "type": "string",
            "format": "date-time",
            "description": "Время завершения действия сертификата"
          },
          "signatureAlgOid": {
            "type": "string",
            "description": "Алгоритм подписи сертификата"
          }
        }
      },
      "KeyContainerUploadResult": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Идентификатор загруженного крипто-контейнера"
          }
        }
      },
      "Error": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string",
            "description": "Тип ошибки"
          },
          "error": {
            "type": "string",
            "description": "Текстовое описание ошибки"
          },
          "uid": {
            "type": "string",
            "description": "Уникальный идентификатор ошибки"
          },
          "causedBy": {
            "type": "array",
            "description": "Список вложенных ошибков, которые привели к полученной ошибке",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "KeyContainer": {
        "type": "object",
        "required": [
          "id",
          "type",
          "created_at",
          "updated_at",
          "online_status"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "Идентификатор контейнера"
          },
          "type": {
            "type": "string",
            "description": "Тип контейнера\n- `PERSISTENT` - неизвлекаемый (загруженный через API)\n- `REMOVABLE` - извлекаемый (аппаратный ключ)\n",
            "enum": [
              "PERSISTENT",
              "REMOVABLE"
            ]
          },
          "name": {
            "type": "string",
            "description": "Имя контейнера"
          },
          "alias": {
            "type": "string",
            "description": "Алиас контейнера"
          },
          "created_at": {
            "type": "string",
            "description": "Дата и время загрузки"
          },
          "updated_at": {
            "type": "string",
            "description": "Дата и время последнего обновления данных"
          },
          "online_status": {
            "type": "string",
            "description": "Состояние доступности ключевого контейнера:\n- `ONLINE` - контейнер доступен\n- `OFFLINE` - контейнер недоступен, извлечён\n",
            "enum": [
              "ONLINE",
              "OFFLINE"
            ]
          },
          "two_factor_mode": {
            "type": "string",
            "description": "Режим использования двухфакторного подтверждения\n- `DEFAULT` - использовать по умолчанию (глобальная настройка)\n- `ENABLED` - использовать принудительно\n- `DISABLED` - не использовать принудительно\n",
            "enum": [
              "DEFAULT",
              "ENABLED",
              "DISABLED"
            ]
          }
        }
      },
      "KeyContainerUpdateRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "Имя контейнера",
            "example": ""
          },
          "alias": {
            "type": "string",
            "description": "Дополнительное имя контейнера",
            "example": ""
          },
          "pin": {
            "type": "string",
            "description": "PIN код контейнера\n",
            "example": ""
          },
          "two_factor_mode": {
            "type": "string",
            "description": "Режим использования двухфакторного подтверждения\n- `DEFAULT` - использовать по умолчанию (глобальная настройка)\n- `ENABLED` - использовать принудительно\n- `DISABLED` - не использовать принудительно\n",
            "enum": [
              "DEFAULT",
              "ENABLED",
              "DISABLED"
            ],
            "example": ""
          }
        }
      },
      "PaginatedResponse": {
        "type": "object",
        "required": [
          "total",
          "items"
        ],
        "properties": {
          "total": {
            "type": "integer",
            "description": "Общее количество записей в базе соответствующих фильтру"
          },
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "description": "Список записей",
              "properties": {}
            }
          }
        }
      }
    },
    "securitySchemes": {
      "BasicAuth": {
        "type": "http",
        "scheme": "basic"
      },
      "OAuth2": {
        "type": "oauth2",
        "description": "Это API использует OAuth 2 с implicit grant flow.",
        "flows": {
          "implicit": {
            "authorizationUrl": "https://omnibox.kgost.ru/oauth/authorize",
            "scopes": {
              "dss": "Доступ к функционалу DSS сервиса"
            }
          }
        }
      }
    }
  }
}
