openapi: 3.0.0
paths:
  /xml/sign:
    post:
      operationId: CmsController_xmlSign
      summary: Создает подпись XML
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                xml:
                  type: string
                  description: XML документ в формате Base64
                  example: >-
                    PD94bWwgdmVyc2lvbj0iMS4wIj8+PEVudmVsb3BlPjxEYXRhPkhlbGxvPC9EYXRhPjwvRW52ZWxvcGU+
                cert:
                  type: string
                  description: Сертификат в формате Base64
                  example: MIIDEjCCAr+gAwIBAgITEgB8aIV38+X33Xg==
                elementTagName:
                  type: string
                  description: >-
                    Имя тега XML элемента, который нужно подписать (по умолчанию
                    корневой). Для FCS.
                  example: ''
                password:
                  type: string
                  description: Пароль от ключевого контейнера
                  example: ''
                signatureType:
                  type: string
                  enum:
                    - FCS
                    - SMEV
                  description: >-
                    Тип подписи: FCS (Free Customs Scheme, трансформация v1.1)
                    или SMEV (СМЭВ)
                  example: FCS
                  default: FCS
                elementId:
                  type: string
                  description: >-
                    Id подписываемого элемента для СМЭВ (по умолчанию
                    SIGNED_BY_CALLER)
                  example: SIGNED_BY_CALLER
                signatureParentTag:
                  type: string
                  description: >-
                    Локальное имя элемента-контейнера для вставки подписи для
                    СМЭВ (по умолчанию CallerInformationSystemSignature)
                  example: CallerInformationSystemSignature
              required:
                - xml
                - cert
            examples:
              default:
                value:
                  xml: >-
                    PD94bWwgdmVyc2lvbj0iMS4wIj8+PEVudmVsb3BlPjxEYXRhPkhlbGxvPC9EYXRhPjwvRW52ZWxvcGU+
                  cert: MIIDEjCCAr+gAwIBAgITEgB8aIV38+X33Xg==
                  elementTagName: ''
                  password: ''
                  signatureType: FCS
              smev:
                value:
                  xml: PD94bWwg...
                  cert: MIIDEj...
                  signatureType: SMEV
                  elementId: SIGNED_BY_CALLER
                  signatureParentTag: CallerInformationSystemSignature
      responses:
        default:
          description: ''
          content:
            application/json:
              schema:
                properties:
                  status:
                    type: number
                  xml:
                    type: string
      tags:
        - XMLDSig
  /xml/sign-file:
    post:
      operationId: CmsController_xmlSignFile
      summary: Создает подпись XML (загрузка файла)
      parameters: []
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                xml:
                  type: string
                  format: binary
                  description: XML файл
                cert:
                  type: string
                  format: binary
                  description: Сертификат (файл .cer, .p7b)
                elementTagName:
                  type: string
                  description: >-
                    Имя тега XML элемента, который нужно подписать (по умолчанию
                    корневой). Для FCS.
                  example: ''
                password:
                  type: string
                  description: Пароль от ключевого контейнера
                  example: ''
                signatureType:
                  type: string
                  enum:
                    - FCS
                    - SMEV
                  description: 'Тип подписи: FCS (Free Customs Scheme) или SMEV (СМЭВ)'
                  example: FCS
                  default: FCS
                elementId:
                  type: string
                  description: >-
                    Id подписываемого элемента для СМЭВ (по умолчанию
                    SIGNED_BY_CALLER)
                  example: SIGNED_BY_CALLER
                signatureParentTag:
                  type: string
                  description: >-
                    Локальное имя элемента-контейнера для вставки подписи для
                    СМЭВ
                  example: CallerInformationSystemSignature
              required:
                - xml
                - cert
      responses:
        default:
          description: Подписанный XML файл
          content:
            application/octet-stream:
              schema:
                type: string
                format: binary
      tags:
        - XMLDSig
  /xml/verify:
    post:
      operationId: CmsController_xmlVerify
      summary: Проверяет подпись XML
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                xml:
                  type: string
                  description: Подписанный XML документ в формате Base64
                  example: PD94bWwgdmVyc2lvbj0iMS4wIj8+...
              required:
                - xml
      responses:
        default:
          description: ''
          content:
            application/json:
              schema:
                properties:
                  isValid:
                    type: boolean
                  isValidSign:
                    type: boolean
                  isCertChainValid:
                    type: boolean
                    nullable: true
                  isFCSSignature:
                    type: boolean
                    nullable: true
                    description: >-
                      Признак XML подписи для FCS (Free Customs Scheme, содержит
                      CMS подпись в SignatureValue)
                  isSMEVSignature:
                    type: boolean
                    nullable: true
                    description: >-
                      Признак XML подписи для СМЭВ (трансформация
                      urn://smev-gov-ru/xmldsig/transform)
                  certificate:
                    type: object
                    properties:
                      subjectName:
                        type: string
                      issuerName:
                        type: string
                      serialNumber:
                        type: string
                      notBefore:
                        type: string
                        format: date-time
                      notAfter:
                        type: string
                        format: date-time
                      thumbprint:
                        type: string
                  error:
                    type: string
      tags:
        - XMLDSig
  /xml/verify-file:
    post:
      operationId: CmsController_xmlVerifyFile
      summary: Проверяет подпись XML (загрузка файла)
      parameters: []
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                xml:
                  type: string
                  format: binary
                  description: Подписанный XML файл
              required:
                - xml
      responses:
        default:
          description: ''
          content:
            application/json:
              schema:
                properties:
                  isValid:
                    type: boolean
                  isValidSign:
                    type: boolean
                  isCertChainValid:
                    type: boolean
                    nullable: true
                  isFCSSignature:
                    type: boolean
                    nullable: true
                    description: >-
                      Признак XML подписи для FCS (Free Customs Scheme, содержит
                      CMS подпись в SignatureValue)
                  isSMEVSignature:
                    type: boolean
                    nullable: true
                    description: >-
                      Признак XML подписи для СМЭВ (трансформация
                      urn://smev-gov-ru/xmldsig/transform)
                  certificate:
                    type: object
                    properties:
                      subjectFriendlyName:
                        type: string
                      issuerFriendlyName:
                        type: string
                      subjectName:
                        type: string
                      issuerName:
                        type: string
                      serialNumber:
                        type: string
                      notBefore:
                        type: string
                        format: date-time
                      notAfter:
                        type: string
                        format: date-time
                      thumbprint:
                        type: string
                      signatureAlgorithm:
                        type: string
                      signatureDigestAlgorithm:
                        type: string
                      publicKeyAlgorithm:
                        type: string
                  error:
                    type: string
      tags:
        - XMLDSig
  /cms/verify:
    post:
      operationId: CmsController_cmsVerify
      summary: Проверяет подписанный CMS
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CmsVerifyReqDto'
      responses:
        default:
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CmsVerifyResDto'
      tags:
        - CMS
  /cms/verify-file:
    post:
      operationId: CmsController_cmsVerifyFile
      summary: Проверяет подписанный CMS (загрузка файла)
      parameters: []
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/CmsVerifyFileDto'
      responses:
        default:
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CmsVerifyResDto'
      tags:
        - CMS
  /cms/sign:
    post:
      operationId: CmsController_cmsSign
      summary: Создает подпись данных в формате CMS
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CmsSignReqDto'
      responses:
        default:
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CmsSignResDto'
      tags:
        - CMS
  /cms/sign-file:
    post:
      operationId: CmsController_cmsSignFile
      summary: Создает подпись файла в формате CMS (загрузка файла)
      parameters: []
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/CmsSignFileDto'
      responses:
        default:
          description: Подписанный CMS файл
          content:
            application/octet-stream:
              schema:
                type: string
                format: binary
      tags:
        - CMS
  /cms/sign-file-batch:
    post:
      operationId: CmsController_cmsSignFileBatch
      summary: Пакетная подпись файлов в формате CMS
      description: >-
        Загрузить несколько файлов (поле data — массив файлов), один сертификат
        (cert). Синхронный режим: без callbackUrl — ответ 200 с массивом {
        results: [ { fileName, cms } ] }. Асинхронный режим: указать callbackUrl
        — ответ 202, результат будет отправлен POST на callbackUrl (тело: {
        jobId, results } или { jobId, error }).
      parameters: []
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                data:
                  type: array
                  items:
                    type: string
                    format: binary
                  description: Файлы для подписания (можно выбрать несколько)
                cert:
                  type: string
                  format: binary
                  description: Сертификат (файл .cer, .p7b)
                password:
                  type: string
                  description: Пароль от ключевого контейнера
                callbackUrl:
                  type: string
                  description: >-
                    URL для асинхронной доставки результата (при указании —
                    ответ 202, результат уйдёт POST на этот URL)
              required:
                - data
                - cert
      responses:
        '200':
          description: Синхронный результат
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CmsSignBatchResDto'
        '202':
          description: Запрос принят в обработку
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CmsSignBatchAcceptedDto'
      tags:
        - CMS
  /cms/stamp:
    post:
      operationId: CmsController_cmsStamp
      summary: Создает печатную форму со штампом подписанного pdf документа
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CmsStampReqDto'
      responses:
        default:
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CmsStampResDto'
      tags:
        - CMS
  /cms/stamp-file:
    post:
      operationId: CmsController_cmsStampFile
      summary: >-
        Создает печатную форму со штампом подписанного pdf документа (загрузка
        файла)
      parameters: []
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/CmsStampFileReqDto'
      responses:
        default:
          description: PDF документ с визуализацией штампов подписей
          content:
            application/pdf:
              schema:
                type: string
                format: binary
      tags:
        - CMS
  /cms/enhance:
    post:
      operationId: CmsController_cmsEnhance
      summary: >-
        Улучшает подпись CMS до указанного типа (CAdES-T, CAdES-X Long Type 1,
        CAdES-A)
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CmsEnhanceReqDto'
      responses:
        default:
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CmsEnhanceResDto'
      tags:
        - CMS
  /cms/enhance-file:
    post:
      operationId: CmsController_cmsEnhanceFile
      summary: Улучшает подпись CMS до указанного типа (загрузка файла)
      parameters: []
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/CmsEnhanceFileDto'
      responses:
        default:
          description: Улучшенный CMS файл
          content:
            application/octet-stream:
              schema:
                type: string
                format: binary
      tags:
        - CMS
  /pades/verify:
    post:
      operationId: CmsController_padesVerify
      summary: Проверяет подпись PDF документа в формате PAdES
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PadesVerifyReqDto'
      responses:
        default:
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PadesVerifyResDto'
      tags:
        - PAdES
  /pades/verify-file:
    post:
      operationId: CmsController_padesVerifyFile
      summary: Проверяет подпись PDF документа в формате PAdES (загрузка файла)
      parameters: []
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PadesVerifyFileDto'
      responses:
        default:
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PadesVerifyResDto'
      tags:
        - PAdES
  /pades/sign:
    post:
      operationId: CmsController_padesSign
      summary: Создает подпись PDF документа в формате PAdES с визуализацией
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PadesSignReqDto'
      responses:
        default:
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PadesSignResDto'
      tags:
        - PAdES
  /pades/sign-file:
    post:
      operationId: CmsController_padesSignFile
      summary: >-
        Создает подпись PDF документа в формате PAdES с визуализацией (загрузка
        файла)
      parameters: []
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PadesSignFileDto'
      responses:
        default:
          description: Подписанный PDF файл
          content:
            application/pdf:
              schema:
                type: string
                format: binary
      tags:
        - PAdES
  /cms/merge:
    post:
      operationId: CmsController_cmsMerge
      summary: Объединяет несколько CAdES подписей в одну
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CmsMergeReqDto'
      responses:
        default:
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CmsMergeResDto'
      tags:
        - CMS
  /cms/merge-file:
    post:
      operationId: CmsController_cmsMergeFile
      summary: Объединяет несколько CAdES подписей в одну (загрузка файлов)
      parameters: []
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/CmsMergeFileDto'
      responses:
        default:
          description: Объединенная CAdES подпись
          content:
            application/octet-stream:
              schema:
                type: string
                format: binary
      tags:
        - CMS
  /cert/verify:
    post:
      operationId: CmsController_certVerify
      summary: 'Проверяет сертификат: срок действия и цепочку сертификатов'
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CertVerifyReqDto'
      responses:
        default:
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CertVerifyResDto'
      tags:
        - Certificate
  /cert/verify-file:
    post:
      operationId: CmsController_certVerifyFile
      summary: 'Проверяет сертификат из файла: срок действия и цепочку сертификатов'
      parameters: []
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                cert:
                  type: string
                  format: binary
                  description: Файл сертификата
              required:
                - cert
      responses:
        default:
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CertVerifyResDto'
      tags:
        - Certificate
  /cipher/encrypt-file:
    post:
      operationId: CipherController_encryptFile
      summary: Шифрование файла
      description: Шифрует файл на сертификаты получателей
      parameters: []
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/CipherEncryptFileDto'
      responses:
        '200':
          description: Возвращает зашифрованный файл (.enc)
      tags:
        - Cipher
  /cipher/encrypt:
    post:
      operationId: CipherController_encrypt
      summary: Шифрование данных (Base64)
      description: Шифрует данные (Base64) на сертификаты получателей (Base64)
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CipherEncryptReqDto'
      responses:
        '200':
          description: Возвращает зашифрованные данные в Base64
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CipherEncryptResDto'
        '400':
          description: Ошибка валидации
        '500':
          description: Внутренняя ошибка сервера
      tags:
        - Cipher
  /cipher/decrypt-file:
    post:
      operationId: CipherController_decryptFileController
      summary: Расшифрование файла
      description: >-
        Расшифровывает файл с использованием закрытого ключа, доступного в
        системе
      parameters: []
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/CipherDecryptFileDto'
      responses:
        '200':
          description: Возвращает расшифрованный файл
      tags:
        - Cipher
  /cipher/decrypt:
    post:
      operationId: CipherController_decrypt
      summary: Расшифрование данных (Base64)
      description: >-
        Расшифровывает данные (Base64) с использованием закрытого ключа в
        системе
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CipherDecryptReqDto'
      responses:
        '200':
          description: Возвращает расшифрованные данные в Base64
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CipherDecryptResDto'
        '400':
          description: Ошибка валидации
        '500':
          description: Внутренняя ошибка сервера
      tags:
        - Cipher
  /cipher/recipients-file:
    post:
      operationId: CipherController_getRecipientsFile
      summary: Получение сведений о получателях зашифрованного файла
      description: >-
        Возвращает информацию о сертификатах получателей зашифрованного файла
        без расшифровки
      parameters: []
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/CipherGetRecipientsFileDto'
      responses:
        '200':
          description: Возвращает список получателей
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CipherGetRecipientsResDto'
      tags:
        - Cipher
  /cipher/recipients:
    post:
      operationId: CipherController_getRecipients
      summary: Получение сведений о получателях зашифрованных данных (Base64)
      description: >-
        Возвращает информацию о сертификатах получателей зашифрованных данных
        без расшифровки
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CipherGetRecipientsReqDto'
      responses:
        '200':
          description: Возвращает список получателей
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CipherGetRecipientsResDto'
        '400':
          description: Ошибка валидации
        '500':
          description: Внутренняя ошибка сервера
      tags:
        - Cipher
info:
  title: КриптоАРМ Server
  description: Электронная подпись и проверка документов
  version: 1.3.6
  contact: {}
tags:
  - name: CMS
    description: Методы для работы с CMS (Cryptogrphic Message Syntax)
  - name: PAdES
    description: Методы для работы с PAdES (PDF Advanced Electronic Signatures)
  - name: XMLDSig
    description: Методы для работы с XMLDSig (XML Digital Signature)
  - name: Cipher
    description: Методы шифрования и расшифрования данных
servers: []
components:
  schemas:
    CmsVerifyReqDto:
      type: object
      properties:
        cms:
          type: string
          description: >-
            CMS данные в формате Base64 (может быть указано несколько через
            разделитель ',')
          example: >-
            MIAGCSqGSIb3DQEHAqCAMIACAQExDjAMBggqhQMHAQECAgUAMIAGCSqGSIb3DQEHAQAAoIIDFzCCAxMwggLAoAMCAQICExIAZOzhNSUHdXwAoIsAAgBk7OEwCgYIKoUDBwEBAwIwfzEjMCEGCSqGSIb3DQEJARYUc3VwcG9ydEBjcnlwdG9wcm8ucnUxCzAJBgNVBAYTAlJVMQ8wDQYDVQQHEwZNb3Njb3cxFzAVBgNVBAoTDkNSWVBUTy1QUk8gTExDMSEwHwYDVQQDExhDUllQVE8tUFJPIFRlc3QgQ2VudGVyIDIwHhcNMjQwODI2MTYxNTM3WhcNMjQxMDI2MTYyNTM3WjAVMRMwEQYDVQQDDAplc2lhIHRlc3QzMGYwHwYIKoUDBwEBAQEwEwYHKoUDAgIkAAYIKoUDBwEBAgIDQwAEQPo0KDfZchT+XsmrS6mVIVsQvPSKE7TbGcebobrGYMQfrJXPivzzqAc/y3IyAqfrkXOhQe0FUvtv6XVVtxZ6RIijggF2MIIBcjAOBgNVHQ8BAf8EBAMCBPAwEwYDVR0lBAwwCgYIKwYBBQUHAwMwHQYDVR0OBBYEFLy/55q/XqnMlH/ZI3uciCtdNzmsMB8GA1UdIwQYMBaAFBPuDprx4ItKrhkW78vExS2pGTcdMFwGA1UdHwRVMFMwUaBPoE2GS2h0dHA6Ly90ZXN0Y2EuY3J5cHRvcHJvLnJ1L0NlcnRFbnJvbGwvQ1JZUFRPLVBSTyUyMFRlc3QlMjBDZW50ZXIlMjAyKDIpLmNybDCBrAYIKwYBBQUHAQEEgZ8wgZwwZAYIKwYBBQUHMAKGWGh0dHA6Ly90ZXN0Y2EuY3J5cHRvcHJvLnJ1L0NlcnRFbnJvbGwvdGVzdC1jYS0yMDE0X0NSWVBUTy1QUk8lMjBUZXN0JTIwQ2VudGVyJTIwMigyKS5jcnQwNAYIKwYBBQUHMAGGKGh0dHA6Ly90ZXN0Y2EuY3J5cHRvcHJvL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AkGA1UEBhMCUlUxDzANBgNVBAcTBk1vc2NvdzEXMBUGA1UEChMOQ1JZUFRPLVBSTyBMTEMxITAfBgNVBAMTGENSWVBUTy1QUk8gVGVzdCBDZW50ZXIgMgITEgBmOpmLPC6Qh25ICQACAGY6mTAMBggqhQMHAQECAgUAoIIBUjAYBgkqhkiG9w0BCQMxCwYJKoZIhvcNAQcBMBwGCSqGSIb3DQEJBTEPFw0yNDExMDEwODAyNDdaMC8GCSqGSIb3DQEJBDEiBCCHiS/b3OSFub0itrTwh/j2gl/BByMrKLTmejmcwbuE9zCB5gYLKoZIhvcNAQkQAi8xgdYwgdMwgdAwgc0wCgYIKoUDBwEBAgIEIEo+eZhh9IFSO5nwndg7ZRUXP6NCwMh+OHphescrQ+eZMIGcMIGEpIGBMH8xIzAhBgkqhkiG9w0BCQEWFHN1cHBvcnRAY3J5cHRvcHJvLnJ1MQswCQYDVQQGEwJSVTEPMA0GA1UEBxMGTW9zY293MRcwFQYDVQQKEw5DUllQVE8tUFJPIExMQzEhMB8GA1UEAxMYQ1JZUFRPLVBSTyBUZXN0IENlbnRlciAyAhMSAGY6mYs8LpCHbkgJAAIAZjqZMAoGCCqFAwcBAQEBBECLVI9kCk65nVtGF42bE1iiZCqeICDqXi8UDGrM82DQ8XggTLSXcgGULY+Yi57hmAguAPv30beMw/X23GlALOZZAAAAAAAA
        data:
          type: string
          description: >-
            Если необходимо проверить открепленную подпись CMS, то также
            необходимо передать сами подписанные данные в формате Base64
          example: dGVzdA==
        enhancedType:
          type: string
          description: Тип улучшения подписи
          example: CAdES-T
        meta:
          type: object
          description: Описание документа
          example:
            fileName: document.pdf
            fileLastModified: 1745935260219
            fileSize: 108595
            stampMargin: 20
            stampColor: '#4c40d2'
            stampScale: 0.6
      required:
        - cms
        - data
        - enhancedType
        - meta
    CmsVerifyResDto:
      type: object
      properties:
        status:
          type: number
          example: 200
        message:
          type: string
          example: ''
        isValid:
          type: boolean
          example: true
        isValidSign:
          type: boolean
          example: true
        signs:
          example:
            - cadesTypeName: CAdES-BES
              certificate:
                version: 3
                status: true
                subjectFriendlyName: esia test3
                issuerFriendlyName: CRYPTO-PRO Test Center 2
                subjectName: CN=esia test3
                issuerName: "E=support@cryptopro.ru\r\nC=RU\r\nL=Moscow\r\nO=CRYPTO-PRO LLC\r\nCN=CRYPTO-PRO Test Center 2"
                notAfter: '2024-10-26T16:25:37.000Z'
                notBefore: '2024-08-26T16:15:37.000Z'
                serialNumber: 120064ECE1352507757C00A08B00020064ECE1
                thumbprint: 29063cd83537dbbd0a221705859b8f6e5bec5ad0
                signatureAlgorithm: 1.2.643.7.1.1.3.2
                signatureDigestAlgorithm: 1.2.643.7.1.1.2.2
                publicKeyAlgorithm: 1.2.643.7.1.1.1.1
              certificateData: MIIDEz...
              issuerName: >-
                E=support@cryptopro.ru, C=RU, L=Moscow, O=CRYPTO-PRO LLC,
                CN=CRYPTO-PRO Test Center 2
              serialNumber: 120064ECE1352507757C00A08B00020064ECE1
              signatureAlgorithm: 1.2.643.7.1.1.3.2
              signatureDigestAlgorithm: 1.2.643.7.1.1.2.2
              certs:
                - status: true
                  subjectFriendlyName: esia test3
                  issuerFriendlyName: CRYPTO-PRO Test Center 2
                  subjectName: CN=esia test3
                  issuerName: "E=support@cryptopro.ru\r\nC=RU\r\nL=Moscow\r\nO=CRYPTO-PRO LLC\r\nCN=CRYPTO-PRO Test Center 2"
                  notAfter: '2024-10-26T16:25:37.000Z'
                  notBefore: '2024-08-26T16:15:37.000Z'
                  serialNumber: 120064ECE1352507757C00A08B00020064ECE1
                  thumbprint: 29063cd83537dbbd0a221705859b8f6e5bec5ad0
                  signatureAlgorithm: 1.2.643.7.1.1.3.2
                  signatureDigestAlgorithm: 1.2.643.7.1.1.2.2
                  publicKeyAlgorithm: 1.2.643.7.1.1.1.1
              isCertChainValid: true
          type: array
          items:
            type: string
      required:
        - status
        - message
        - isValid
        - isValidSign
        - signs
    CmsVerifyFileDto:
      type: object
      properties:
        cms:
          type: string
          format: binary
          description: CMS файл для проверки подписи
        data:
          type: string
          format: binary
          description: Файл с данными для проверки открепленной подписи (опционально)
        enhancedType:
          type: string
          description: Тип улучшения подписи
          example: CAdES-T
        meta:
          type: string
          description: Параметры подписи (JSON строка)
          example: '{"stampMargin": 20, "stampColor":"#4c40d2", "stampScale": 0.6}'
      required:
        - cms
    CmsSignReqDto:
      type: object
      properties:
        cert:
          type: string
          description: Сертификат в формате Base64
          example: >-
            MIIDEjCCAr+gAwIBAgITEgBn07BJ5IW55Hp+pgACAGfTsDAKBggqhQMHAQEDAjB/MSMwIQYJKoZIhvcNAQkBFhRzdXBwb3J0QGNyeXB0b3Byby5ydTELMAkGA1UEBhMCUlUxDzANBgNVBAcTBk1vc2NvdzEXMBUGA1UEChMOQ1JZUFRPLVBSTyBMTEMxITAfBgNVBAMTGENSWVBUTy1QUk8gVGVzdCBDZW50ZXIgMjAeFw0yNTAyMDUxNTQ2NTFaFw0yNTA0MDUxNTU2NTFaMBQxEjAQBgNVBAMMCUVTSUEgVEVTVDBmMB8GCCqFAwcBAQEBMBMGByqFAwICJAAGCCqFAwcBAQICA0MABEDFOevG2eeXF0uPQcmGQ9u95RKOKvOxC3d/i1oGcSqF2TRZiDDm7HxbDNFHXlp82SqDndlZvQgZ2+tR6hwRFanho4IBdjCCAXIwDgYDVR0PAQH/BAQDAgTwMBMGA1UdJQQMMAoGCCsGAQUFBwMCMB0GA1UdDgQWBBT9bUjMYSoPX55mzngQVYGKm0UApzAfBgNVHSMEGDAWgBQT7g6a8eCLSq4ZFu/LxMUtqRk3HTBcBgNVHR8EVTBTMFGgT6BNhktodHRwOi8vdGVzdGNhLmNyeXB0b3Byby5ydS9DZXJ0RW5yb2xsL0NSWVBUTy1QUk8lMjBUZXN0JTIwQ2VudGVyJTIwMigyKS5jcmwwgawGCCsGAQUFBwEBBIGfMIGcMGQGCCsGAQUFBzAChlhodHRwOi8vdGVzdGNhLmNyeXB0b3Byby5ydS9DZXJ0RW5yb2xsL3Rlc3QtY2EtMjAxNF9DUllQVE8tUFJPJTIwVGVzdCUyMENlbnRlciUyMDIoMikuY3J0MDQGCCsGAQUFBzABhihodHRwOi8vdGVzdGNhLmNyeXB0b3Byby5ydS9vY3NwL29jc3Auc3JmMAoGCCqFAwcBAQMCA0EACUCRRoLu1airiUr6cuvHQfUZCX8QPhcuFw0DacvtrFDay+kBoWLCkgCXCRwKwy+osz4XF6SezQ8aIV38+X33Xg==
        data:
          type: string
          description: Подписываемые данные в формате Base64
          example: dGVzdA==
        password:
          type: string
          description: Пароль от ключевого контейнера
          example: password
      required:
        - cert
        - data
        - password
    CmsSignResDto:
      type: object
      properties:
        status:
          type: number
          example: 200
        cms:
          type: string
          example: >-
            MIAGCSqGSIb3DQEHAqCAMIACAQExDjAMBggqhQMHAQECAgUAMIAGCSqGSIb3DQEHAaCAJIAEBHRlc3QAAAAAAACgggMXMIIDEzCCAsCgAwIBAgITEgBk7OE1JQd1fACgiwACAGTs4TAKBggqhQMHAQEDAjB/MSMwIQYJKoZIhvcNAQkBFhRzdXBwb3J0QGNyeXB0b3Byby5ydTELMAkGA1UEBhMCUlUxDzANBgNVBAcTBk1vc2NvdzEXMBUGA1UEChMOQ1JZUFRPLVBSTyBMTEMxITAfBgNVBAMTGENSWVBUTy1QUk8gVGVzdCBDZW50ZXIgMjAeFw0yNDA4MjYxNjE1MzdaFw0yNDEwMjYxNjI1MzdaMBUxEzARBgNVBAMMCmVzaWEgdGVzdDMwZjAfBggqhQMHAQEBATATBgcqhQMCAiQABggqhQMHAQECAgNDAARA+jQoN9lyFP5eyatLqZUhWxC89IoTtNsZx5uhusZgxB+slc+K/POoBz/LcjICp+uRc6FB7QVS+2/pdVW3FnpEiKOCAXYwggFyMA4GA1UdDwEB/wQEAwIE8DATBgNVHSUEDDAKBggrBgEFBQcDAzAdBgNVHQ4EFgQUvL/nmr9eqcyUf9kje5yIK103OawwHwYDVR0jBBgwFoAUE+4OmvHgi0quGRbvy8TFLakZNx0wXAYDVR0fBFUwUzBRoE+gTYZLaHR0cDovL3Rlc3RjYS5jcnlwdG9wcm8ucnUvQ2VydEVucm9sbC9DUllQVE8tUFJPJTIwVGVzdCUyMENlbnRlciUyMDIoMikuY3JsMIGsBggrBgEFBQcBAQSBnzCBnDBkBggrBgEFBQcwAoZYaHR0cDovL3Rlc3RjYS5jcnlwdG9wcm8ucnUvQ2VydEVucm9sbC90ZXN0LWNhLTIwMTRfQ1JZUFRPLVBSTyUyMFRlc3QlMjBDZW50ZXIlMjAyKDIpLmNydDA0BggrBgEFBQcwAYYoaHR0cDovL3Rlc3RjYS5jcnlwdG9wcm8ucnUvb2NzcC9vY3NwLnNyZjAKBggqhQMHAQEDAgNBABNo1b4fDyCZ+5Xv9IIJTuT6asXtrqK9vcFEi+TUYR1ZHrmYwYpMcoOXquGtNT8ue1jJfLw65mcErC9TFRXN1GsxgfswgfgCAQEwgZYwfzEjMCEGCSqGSIb3DQEJARYUc3VwcG9ydEBjcnlwdG9wcm8ucnUxCzAJBgNVBAYTAlJVMQ8wDQYDVQQHEwZNb3Njb3cxFzAVBgNVBAoTDkNSWVBUTy1QUk8gTExDMSEwHwYDVQQDExhDUllQVE8tUFJPIFRlc3QgQ2VudGVyIDICExIAZOzhNSUHdXwAoIsAAgBk7OEwDAYIKoUDBwEBAgIFADAKBggqhQMHAQEBAQRA4ObyQitdMa6u4yq/Te4jyEu71zOR9T8kimrHjcwTznMojnfRmhK4+vsUYjDzr7r2Ozbz04eqoJ5YScdnM18EMQAAAAAAAA==
      required:
        - status
        - cms
    CmsSignFileDto:
      type: object
      properties:
        data:
          type: string
          format: binary
          description: Файл для подписания
        cert:
          type: string
          format: binary
          description: Сертификат (файл .cer, .p7b)
        password:
          type: string
          description: Пароль от ключевого контейнера
          example: password
      required:
        - data
    CmsSignBatchItemResDto:
      type: object
      properties:
        fileName:
          type: string
          description: Имя файла
        cms:
          type: string
          description: Подпись CMS в Base64
      required:
        - fileName
        - cms
    CmsSignBatchResDto:
      type: object
      properties:
        results:
          description: Подписанные файлы
          type: array
          items:
            $ref: '#/components/schemas/CmsSignBatchItemResDto'
      required:
        - results
    CmsSignBatchAcceptedDto:
      type: object
      properties:
        jobId:
          type: string
          description: Идентификатор задания
        message:
          type: string
          description: Сообщение
      required:
        - jobId
        - message
    CmsStampReqDto:
      type: object
      properties:
        cms:
          type: string
          description: CMS данные в формате Base64
          example: >-
            MIAGCSqGSIb3DQEHAqCAMIACAQExDjAMBggqhQMHAQECAgUAMIAGCSqGSIb3DQEHAQAAoIIDFzCCAxMwggLAoAMCAQICExIAZOzhNSUHdXwAoIsAAgBk7OEwCgYIKoUDBwEBAwIwfzEjMCEGCSqGSIb3DQEJARYUc3VwcG9ydEBjcnlwdG9wcm8ucnUxCzAJBgNVBAYTAlJVMQ8wDQYDVQQHEwZNb3Njb3cxFzAVBgNVBAoTDkNSWVBUTy1QUk8gTExDMSEwHwYDVQQDExhDUllQVE8tUFJPIFRlc3QgQ2VudGVyIDIwHhcNMjQwODI2MTYxNTM3WhcNMjQxMDI2MTYyNTM3WjAVMRMwEQYDVQQDDAplc2lhIHRlc3QzMGYwHwYIKoUDBwEBAQEwEwYHKoUDAgIkAAYIKoUDBwEBAgIDQwAEQPo0KDfZchT+XsmrS6mVIVsQvPSKE7TbGcebobrGYMQfrJXPivzzqAc/y3IyAqfrkXOhQe0FUvtv6XVVtxZ6RIijggF2MIIBcjAOBgNVHQ8BAf8EBAMCBPAwEwYDVR0lBAwwCgYIKwYBBQUHAwMwHQYDVR0OBBYEFLy/55q/XqnMlH/ZI3uciCtdNzmsMB8GA1UdIwQYMBaAFBPuDprx4ItKrhkW78vExS2pGTcdMFwGA1UdHwRVMFMwUaBPoE2GS2h0dHA6Ly90ZXN0Y2EuY3J5cHRvcHJvLnJ1L0NlcnRFbnJvbGwvQ1JZUFRPLVBSTyUyMFRlc3QlMjBDZW50ZXIlMjAyKDIpLmNybDCBrAYIKwYBBQUHAQEEgZ8wgZwwZAYIKwYBBQUHMAKGWGh0dHA6Ly90ZXN0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DAgNBAIvpAdkzyCi0eXzLbDBfW5C/S9lUsl5CTb7ruvSzG1bVwMgiYc/13x4xsoVjzjCsoaC9CQQ0ef420U61esVu1l4xggJSMIICTgIBATCBljB/MSMwIQYJKoZIhvcNAQkBFhRzdXBwb3J0QGNyeXB0b3Byby5ydTELMAkGA1UEBhMCUlUxDzANBgNVBAcTBk1vc2NvdzEXMBUGA1UEChMOQ1JZUFRPLVBSTyBMTEMxITAfBgNVBAMTGENSWVBUTy1QUk8gVGVzdCBDZW50ZXIgMgITEgBmOpmLPC6Qh25ICQACAGY6mTAMBggqhQMHAQECAgUAoIIBUjAYBgkqhkiG9w0BCQMxCwYJKoZIhvcNAQcBMBwGCSqGSIb3DQEJBTEPFw0yNDExMDEwODAyNDdaMC8GCSqGSIb3DQEJBDEiBCCHiS/b3OSFub0itrTwh/j2gl/BByMrKLTmejmcwbuE9zCB5gYLKoZIhvcNAQkQAi8xgdYwgdMwgdAwgc0wCgYIKoUDBwEBAgIEIEo+eZhh9IFSO5nwndg7ZRUXP6NCwMh+OHphescrQ+eZMIGcMIGEpIGBMH8xIzAhBgkqhkiG9w0BCQEWFHN1cHBvcnRAY3J5cHRvcHJvLnJ1MQswCQYDVQQGEwJSVTEPMA0GA1UEBxMGTW9zY293MRcwFQYDVQQKEw5DUllQVE8tUFJPIExMQzEhMB8GA1UEAxMYQ1JZUFRPLVBSTyBUZXN0IENlbnRlciAyAhMSAGY6mYs8LpCHbkgJAAIAZjqZMAoGCCqFAwcBAQEBBECLVI9kCk65nVtGF42bE1iiZCqeICDqXi8UDGrM82DQ8XggTLSXcgGULY+Yi57hmAguAPv30beMw/X23GlALOZZAAAAAAAA
        data:
          type: string
          description: Подписанные данные (pdf документ) в формате Base64
          example: dGVzdA==
        params:
          type: object
          description: Параметры штампа подписи (JSON строка)
          example: '{"stampMargin": 20, "stampColor":"#4c40d2", "stampScale": 0.6}'
      required:
        - cms
        - data
    CmsStampResDto:
      type: object
      properties:
        status:
          type: number
          example: 200
        dataStamp:
          type: string
          example: JVBERi0xLjcKJ...=
          description: PDF документ с визуализацией штампов подписей в формате Base64
      required:
        - status
        - dataStamp
    CmsStampFileReqDto:
      type: object
      properties:
        cms:
          type: string
          format: binary
          description: Файл открепленной подписи PDF документа
        data:
          type: string
          format: binary
          description: PDF документ
        params:
          type: object
          description: Параметры штампа подписи (JSON строка)
          example: '{"stampMargin": 20, "stampColor":"#4c40d2", "stampScale": 0.6}'
      required:
        - cms
        - data
    CmsEnhanceReqDto:
      type: object
      properties:
        cms:
          type: string
          description: CMS данные в формате Base64 для улучшения
          example: >-
            MIAGCSqGSIb3DQEHAqCAMIACAQExDjAMBggqhQMHAQECAgUAMIAGCSqGSIb3DQEHAQAAoIIDFzCCAxMwggLAoAMCAQICExIAZOzhNSUHdXwAoIsAAgBk7OEwCgYIKoUDBwEBAwIwfzEjMCEGCSqGSIb3DQEJARYUc3VwcG9ydEBjcnlwdG9wcm8ucnUxCzAJBgNVBAYTAlJVMQ8wDQYDVQQHEwZNb3Njb3cxFzAVBgNVBAoTDkNSWVBUTy1QUk8gTExDMSEwHwYDVQQDExhDUllQVE8tUFJPIFRlc3QgQ2VudGVyIDIwHhcNMjQwODI2MTYxNTM3WhcNMjQxMDI2MTYyNTM3WjAVMRMwEQYDVQQDDAplc2lhIHRlc3QzMGYwHwYIKoUDBwEBAQEwEwYHKoUDAgIkAAYIKoUDBwEBAgIDQwAEQPo0KDfZchT+XsmrS6mVIVsQvPSKE7TbGcebobrGYMQfrJXPivzzqAc/y3IyAqfrkXOhQe0FUvtv6XVVtxZ6RIijggF2MIIBcjAOBgNVHQ8BAf8EBAMCBPAwEwYDVR0lBAwwCgYIKwYBBQUHAwMwHQYDVR0OBBYEFLy/55q/XqnMlH/ZI3uciCtdNzmsMB8GA1UdIwQYMBaAFBPuDprx4ItKrhkW78vExS2pGTcdMFwGA1UdHwRVMFMwUaBPoE2GS2h0dHA6Ly90ZXN0Y2EuY3J5cHRvcHJvLnJ1L0NlcnRFbnJvb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lc3QlMjBDZW50ZXIlMjAyKDIpLmNydDA0BggrBgEFBQcwAYYoaHR0cDovL3Rlc3RjYS5jcnlwdG9wcm8ucnUvb2NzcC9vY3NwLnNyZjAKBggqhQMHAQEDAgNBAIvpAdkzyCi0eXzLbDBfW5C/S9lUsl5CTb7ruvSzG1bVwMgiYc/13x4xsoVjzjCsoaC9CQQ0ef420U61esVu1l4xggJSMIICTgIBATCBljB/MSMwIQYJKoZIhvcNAQkBFhRzdXBwb3J0QGNyeXB0b3Byby5ydTELMAkGA1UEBhMCUlUxDzANBgNVBAcTBk1vc2NvdzEXMBUGA1UEChMOQ1JZUFRPLVBSTyBMTEMxITAfBgNVBAMTGENSWVBUTy1QUk8gVGVzdCBDZW50ZXIgMgITEgBmOpmLPC6Qh25ICQACAGY6mTAMBggqhQMHAQECAgUAoIIBUjAYBgkqhkiG9w0BCQMxCwYJKoZIhvcNAQcBMBwGCSqGSIb3DQEJBTEPFw0yNDExMDEwODAyNDdaMC8GCSqGSIb3DQEJBDEiBCCHiS/b3OSFub0itrTwh/j2gl/BByMrKLTmejmcwbuE9zCB5gYLKoZIhvcNAQkQAi8xgdYwgdMwgdAwgc0wCgYIKoUDBwEBAgIEIEo+eZhh9IFSO5nwndg7ZRUXP6NCwMh+OHphescrQ+eZMIGcMIGEpIGBMH8xIzAhBgkqhkiG9w0BCQEWFHN1cHBvcnRAY3J5cHRvcHJvLnJ1MQswCQYDVQQGEwJSVTEPMA0GA1UEBxMGTW9zY293MRcwFQYDVQQKEw5DUllQVE8tUFJPIExMQzEhMB8GA1UEAxMYQ1JZUFRPLVBSTyBUZXN0IENlbnRlciAyAhMSAGY6mYs8LpCHbkgJAAIAZjqZMAoGCCqFAwcBAQEBBECLVI9kCk65nVtGF42bE1iiZCqeICDqXi8UDGrM82DQ8XggTLSXcgGULY+Yi57hmAguAPv30beMw/X23GlALOZZAAAAAAAA
        enhancedType:
          type: string
          description: Тип улучшения подписи (обязательный)
          example: CAdES-T
          enum:
            - CAdES-T
            - CAdES-X Long Type 1
            - CAdES-A
      required:
        - cms
        - enhancedType
    CmsEnhanceResDto:
      type: object
      properties:
        status:
          type: number
          example: 200
        message:
          type: string
          example: Подпись успешно улучшена
        enhancedCms:
          type: string
          example: >-
            MIAGCSqGSIb3DQEHAqCAMIACAQExDjAMBggqhQMHAQECAgUAMIAGCSqGSIb3DQEHAaCAJIAEBHRlc3QAAAAAAACgggMXMIIDEzCCAsCgAwIBAgITEgBk7OE1JQd1fACgiwACAGTs4TAKBggqhQMHAQEDAjB/MSMwIQYJKoZIhvcNAQkBFhRzdXBwb3J0QGNyeXB0b3Byby5ydTELMAkGA1UEBhMCUlUxDzANBgNVBAcTBk1vc2NvdzEXMBUGA1UEChMOQ1JZUFRPLVBSTyBMTEMxITAfBgNVBAMTGENSWVBUTy1QUk8gVGVzdCBDZW50ZXIgMjAeFw0yNDA4MjYxNjE1MzdaFw0yNDEwMjYxNjI1MzdaMBUxEzARBgNVBAMMCmVzaWEgdGVzdDMwZjAfBggqhQMHAQEBATATBgcqhQMCAiQABggqhQMHAQECAgNDAARA+jQoN9lyFP5eyatLqZUhWxC89IoTtNsZx5uhusZgxB+slc+K/POoBz/LcjICp+uRc6FB7QVS+2/pdVW3FnpEiKOCAXYwggFyMA4GA1UdDwEB/wQEAwIE8DATBgNVHSUEDDAKBggrBgEFBQcDAzAdBgNVHQ4EFgQUvL/nmr9eqcyUf9kje5yIK103OawwHwYDVR0jBBgwFoAUE+4OmvHgi0quGRbvy8TFLakZNx0wXAYDVR0fBFUwUzBRoE+gTYZLaHR0cDovL3Rlc3RjYS5jcnlwdG9wcm8ucnUvQ2VydEVucm9sbC9DUllQVE8tUFJPJTIwVGVzdCUyMENlbnRlciUyMDIoMikuY3JsMIGsBggrBgEFBQcBAQSBnzCBnDBkBggrBgEFBQcwAoZYaHR0cDovL3Rlc3RjYS5jcnlwdG9wcm8ucnUvQ2VydEVucm9sbC90ZXN0LWNhLTIwMTRfQ1JZUFRPLVBSTyUyMFRlc3QlMjBDZW50ZXIlMjAyKDIpLmNydDA0BggrBgEFBQcwAYYoaHR0cDovL3Rlc3RjYS5jcnlwdG9wcm8ucnUvb2NzcC9vY3NwLnNyZjAKBggqhQMHAQEDAgNBABNo1b4fDyCZ+5Xv9IIJTuT6asXtrqK9vcFEi+TUYR1ZHrmYwYpMcoOXquGtNT8ue1jJfLw65mcErC9TFRXN1GsxgfswgfgCAQEwgZYwfzEjMCEGCSqGSIb3DQEJARYUc3VwcG9ydEBjcnlwdG9wcm8ucnUxCzAJBgNVBAYTAlJVMQ8wDQYDVQQHEwZNb3Njb3cxFzAVBgNVBAoTDkNSWVBUTy1QUk8gTExDMSEwHwYDVQQDExhDUllQVE8tUFJPIFRlc3QgQ2VudGVyIDICExIAZOzhNSUHdXwAoIsAAgBk7OEwDAYIKoUDBwEBAgIFADAKBggqhQMHAQEBAQRA4ObyQitdMa6u4yq/Te4jyEu71zOR9T8kimrHjcwTznMojnfRmhK4+vsUYjDzr7r2Ozbz04eqoJ5YScdnM18EMQAAAAAAAA==
      required:
        - status
        - message
        - enhancedCms
    CmsEnhanceFileDto:
      type: object
      properties:
        cms:
          type: string
          format: binary
          description: CMS файл для улучшения подписи
        enhancedType:
          type: string
          description: Тип улучшения подписи (обязательный)
          example: CAdES-T
          enum:
            - CAdES-T
            - CAdES-X Long Type 1
            - CAdES-A
      required:
        - cms
        - enhancedType
    PadesVerifyReqDto:
      type: object
      properties:
        pdf:
          type: string
          description: PDF документ в формате Base64 для проверки подписи
          example: >-
            JVBERi0xLjQKJcOkw7zDtsO8CjIgMCBvYmoKPDwKL0xlbmd0aCAzIDAgUgo+PgpzdHJlYW0K...
        meta:
          type: string
          description: Описание документа (JSON строка)
          example: >-
            {"fileName": "document.pdf", "fileLastModified": 1745935260219,
            "fileSize": 108595, "stampMargin": 20, "stampColor":"#4c40d2",
            "stampScale": 0.6}
      required:
        - pdf
    PadesVerifyResDto:
      type: object
      properties:
        status:
          type: number
          example: 200
        message:
          type: string
          example: ''
        isValid:
          type: boolean
          example: true
        isValidSign:
          type: boolean
          example: true
        signs:
          example:
            - cadesTypeName: CAdES-BES
              certificate:
                version: 3
                status: true
                subjectFriendlyName: esia test3
                issuerFriendlyName: CRYPTO-PRO Test Center 2
                subjectName: CN=esia test3
                issuerName: "E=support@cryptopro.ru\r\nC=RU\r\nL=Moscow\r\nO=CRYPTO-PRO LLC\r\nCN=CRYPTO-PRO Test Center 2"
                notAfter: '2024-10-26T16:25:37.000Z'
                notBefore: '2024-08-26T16:15:37.000Z'
                serialNumber: 120064ECE1352507757C00A08B00020064ECE1
                thumbprint: 29063cd83537dbbd0a221705859b8f6e5bec5ad0
                signatureAlgorithm: 1.2.643.7.1.1.3.2
                signatureDigestAlgorithm: 1.2.643.7.1.1.2.2
                publicKeyAlgorithm: 1.2.643.7.1.1.1.1
              certificateData: MIIDEz...
              issuerName: >-
                E=support@cryptopro.ru, C=RU, L=Moscow, O=CRYPTO-PRO LLC,
                CN=CRYPTO-PRO Test Center 2
              serialNumber: 120064ECE1352507757C00A08B00020064ECE1
              signatureAlgorithm: 1.2.643.7.1.1.3.2
              signatureDigestAlgorithm: 1.2.643.7.1.1.2.2
              certs:
                - status: true
                  subjectFriendlyName: esia test3
                  issuerFriendlyName: CRYPTO-PRO Test Center 2
                  subjectName: CN=esia test3
                  issuerName: "E=support@cryptopro.ru\r\nC=RU\r\nL=Moscow\r\nO=CRYPTO-PRO LLC\r\nCN=CRYPTO-PRO Test Center 2"
                  notAfter: '2024-10-26T16:25:37.000Z'
                  notBefore: '2024-08-26T16:15:37.000Z'
                  serialNumber: 120064ECE1352507757C00A08B00020064ECE1
                  thumbprint: 29063cd83537dbbd0a221705859b8f6e5bec5ad0
                  signatureAlgorithm: 1.2.643.7.1.1.3.2
                  signatureDigestAlgorithm: 1.2.643.7.1.1.2.2
                  publicKeyAlgorithm: 1.2.643.7.1.1.1.1
              isCertChainValid: true
          type: array
          items:
            type: string
      required:
        - status
        - message
        - isValid
        - isValidSign
        - signs
    PadesVerifyFileDto:
      type: object
      properties:
        pdf:
          type: string
          format: binary
          description: PDF файл для проверки подписи
        params:
          type: string
          description: Параметры штампа подписи (JSON строка)
          example: '{"stampMargin": 20, "stampColor":"#4c40d2", "stampScale": 0.6}'
      required:
        - pdf
    PadesSignReqDto:
      type: object
      properties:
        pdf:
          type: string
          description: PDF документ в формате Base64
          example: >-
            JVBERi0xLjQKJcOkw7zDtsO8CjIgMCBvYmoKPDwKL0xlbmd0aCAzIDAgUgo+PgpzdHJlYW0K...
        cert:
          type: string
          description: Сертификат в формате Base64
          example: >-
            MIIDEjCCAr+gAwIBAgITEgBn07BJ5IW55Hp+pgACAGfTsDAKBggqhQMHAQEDAjB/MSMwIQYJKoZIhvcNAQkBFhRzdXBwb3J0QGNyeXB0b3Byby5ydTELMAkGA1UEBhMCUlUxDzANBgNVBAcTBk1vc2NvdzEXMBUGA1UEChMOQ1JZUFRPLVBSTyBMTEMxITAfBgNVBAMTGENSWVBUTy1QUk8gVGVzdCBDZW50ZXIgMjAeFw0yNTAyMDUxNTQ2NTFaFw0yNTA0MDUxNTU2NTFaMBQxEjAQBgNVBAMMCUVTSUEgVEVTVDBmMB8GCCqFAwcBAQEBMBMGByqFAwICJAAGCCqFAwcBAQICA0MABEDFOevG2eeXF0uPQcmGQ9u95RKOKvOxC3d/i1oGcSqF2TRZiDDm7HxbDNFHXlp82SqDndlZvQgZ2+tR6hwRFanho4IBdjCCAXIwDgYDVR0PAQH/BAQDAgTwMBMGA1UdJQQMMAoGCCsGAQUFBwMCMB0GA1UdDgQWBBT9bUjMYSoPX55mzngQVYGKm0UApzAfBgNVHSMEGDAWgBQT7g6a8eCLSq4ZFu/LxMUtqRk3HTBcBgNVHR8EVTBTMFGgT6BNhktodHRwOi8vdGVzdGNhLmNyeXB0b3Byby5ydS9DZXJ0RW5yb2xsL0NSWVBUTy1QUk8lMjBUZXN0JTIwQ2VudGVyJTIwMigyKS5jcmwwgawGCCsGAQUFBwEBBIGfMIGcMGQGCCsGAQUFBzAChlhodHRwOi8vdGVzdGNhLmNyeXB0b3Byby5ydS9DZXJ0RW5yb2xsL3Rlc3QtY2EtMjAxNF9DUllQVE8tUFJPJTIwVGVzdCUyMENlbnRlciUyMDIoMikuY3J0MDQGCCsGAQUFBzABhihodHRwOi8vdGVzdGNhLmNyeXB0b3Byby5ydS9vY3NwL29jc3Auc3JmMAoGCCqFAwcBAQMCA0EACUCRRoLu1airiUr6cuvHQfUZCX8QPhcuFw0DacvtrFDay+kBoWLCkgCXCRwKwy+osz4XF6SezQ8aIV38+X33Xg==
        password:
          type: string
          description: Пароль от ключевого контейнера
          example: password
        params:
          type: object
          description: Параметры подписи
          example:
            stampMargin: 20
            stampColor: '#4c40d2'
            stampScale: 0.6
      required:
        - pdf
        - cert
        - password
    PadesSignResDto:
      type: object
      properties:
        status:
          type: number
          example: 200
        message:
          type: string
          example: PDF успешно подписан
        signedPdf:
          type: string
          description: Подписанный PDF документ в формате Base64
          example: >-
            JVBERi0xLjQKJcOkw7zDtsO8CjIgMCBvYmoKPDwKL0xlbmd0aCAzIDAgUgo+PgpzdHJlYW0K...
      required:
        - status
        - message
        - signedPdf
    PadesSignFileDto:
      type: object
      properties:
        pdf:
          type: string
          format: binary
          description: PDF файл для подписания
        cert:
          type: string
          format: binary
          description: Сертификат (файл .cer, .p7b)
        password:
          type: string
          description: Пароль от ключевого контейнера
          example: password
        params:
          type: string
          description: Параметры подписи (JSON строка)
          example: '{"stampMargin": 80, "stampColor": "#4c40d2", "stampScale": 0.6}'
      required:
        - pdf
    CmsMergeReqDto:
      type: object
      properties:
        signatures:
          description: Массив CAdES подписей в формате Base64 для объединения
          example:
            - >-
              MIAGCSqGSIb3DQEHAqCAMIACAQExDjAMBggqhQMHAQECAgUAMIAGCSqGSIb3DQEHAaCAJIAEBHRlc3QAAAAAAACgggMXMIIDEzCCAsCgAwIBAgITEgBk7OE1JQd1fACgiwACAGTs4TAKBggqhQMHAQEDAjB/MSMwIQYJKoZIhvcNAQk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L3Rlc3RjYS5jcnlwdG9wcm8ucnUvb2NzcC9vY3NwLnNyZjAKBggqhQMHAQEDAgNBAIvpAdkzyCi0eXzLbDBfW5C/S9lUsl5CTb7ruvSzG1bVwMgiYc/13x4xsoVjzjCsoaC9CQQ0ef420U61esVu1l4xggJSMIICTgIBATCBljB/MSMwIQYJKoZIhvcNAQkBFhRzdXBwb3J0QGNyeXB0b3Byby5ydTELMAkGA1UEBhMCUlUxDzANBgNVBAcTBk1vc2NvdzEXMBUGA1UEChMOQ1JZUFRPLVBSTyBMTEMxITAfBgNVBAMTGENSWVBUTy1QUk8gVGVzdCBDZW50ZXIgMgITEgBmOpmLPC6Qh25ICQACAGY6mTAMBggqhQMHAQECAgUAoIIBUjAYBgkqhkiG9w0BCQMxCwYJKoZIhvcNAQcBMBwGCSqGSIb3DQEJBTEPFw0yNDExMDEwODAyNDdaMC8GCSqGSIb3DQEJBDEiBCCHiS/b3OSFub0itrTwh/j2gl/BByMrKLTmejmcwbuE9zCB5gYLKoZIhvcNAQkQAi8xgdYwgdMwgdAwgc0wCgYIKoUDBwEBAgIEIEo+eZhh9IFSO5nwndg7ZRUXP6NCwMh+OHphescrQ+eZMIGcMIGEpIGBMH8xIzAhBgkqhkiG9w0BCQEWFHN1cHBvcnRAY3J5cHRvcHJvLnJ1MQswCQYDVQQGEwJSVTEPMA0GA1UEBxMGTW9zY293MRcwFQYDVQQKEw5DUllQVE8tUFJPIExMQzEhMB8GA1UEAxMYQ1JZUFRPLVBSTyBUZXN0IENlbnRlciAyAhMSAGY6mYs8LpCHbkgJAAIAZjqZMAoGCCqFAwcBAQEBBECLVI9kCk65nVtGF42bE1iiZCqeICDqXi8UDGrM82DQ8XggTLSXcgGULY+Yi57hmAguAPv30beMw/X23GlALOZZAAAAAAAA
          type: array
          items:
            type: string
      required:
        - signatures
    CmsMergeResDto:
      type: object
      properties:
        status:
          type: number
          example: 200
        message:
          type: string
          example: Подписи успешно объединены
        mergedSignature:
          type: string
          example: >-
            MIA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Xv9IIJTuT6asXtrqK9vcFEi+TUYR1ZHrmYwYpMcoOXquGtNT8ue1jJfLw65mcErC9TFRXN1GsxgfswgfgCAQEwgZYwfzEjMCEGCSqGSIb3DQEJARYUc3VwcG9ydEBjcnlwdG9wcm8ucnUxCzAJBgNVBAYTAlJVMQ8wDQYDVQQHEwZNb3Njb3cxFzAVBgNVBAoTDkNSWVBUTy1QUk8gTExDMSEwHwYDVQQDExhDUllQVE8tUFJPIFRlc3QgQ2VudGVyIDICExIAZOzhNSUHdXwAoIsAAgBk7OEwDAYIKoUDBwEBAgIFADAKBggqhQMHAQEBAQRA4ObyQitdMa6u4yq/Te4jyEu71zOR9T8kimrHjcwTznMojnfRmhK4+vsUYjDzr7r2Ozbz04eqoJ5YScdnM18EMQAAAAAAAA==
          description: Объединенная CAdES подпись в формате Base64
      required:
        - status
        - message
        - mergedSignature
    CmsMergeFileDto:
      type: object
      properties:
        signatures:
          type: array
          items:
            type: string
            format: binary
          description: Массив файлов CAdES подписей для объединения
      required:
        - signatures
    CertVerifyReqDto:
      type: object
      properties:
        cert:
          type: string
          description: Сертификат в формате Base64
          example: >-
            MIIDEjCCAr+gAwIBAgITEgBn07BJ5IW55Hp+pgACAGfTsDAKBggqhQMHAQEDAjB/MSMwIQYJKoZIhvcNAQkBFhRzdXBwb3J0QGNyeXB0b3Byby5ydTELMAkGA1UEBhMCUlUxDzANBgNVBAcTBk1vc2NvdzEXMBUGA1UEChMOQ1JZUFRPLVBSTyBMTEMxITAfBgNVBAMTGENSWVBUTy1QUk8gVGVzdCBDZW50ZXIgMjAeFw0yNTAyMDUxNTQ2NTFaFw0yNTA0MDUxNTU2NTFaMBQxEjAQBgNVBAMMCUVTSUEgVEVTVDBmMB8GCCqFAwcBAQEBMBMGByqFAwICJAAGCCqFAwcBAQICA0MABEDFOevG2eeXF0uPQcmGQ9u95RKOKvOxC3d/i1oGcSqF2TRZiDDm7HxbDNFHXlp82SqDndlZvQgZ2+tR6hwRFanho4IBdjCCAXIwDgYDVR0PAQH/BAQDAgTwMBMGA1UdJQQMMAoGCCsGAQUFBwMCMB0GA1UdDgQWBBT9bUjMYSoPX55mzngQVYGKm0UApzAfBgNVHSMEGDAWgBQT7g6a8eCLSq4ZFu/LxMUtqRk3HTBcBgNVHR8EVTBTMFGgT6BNhktodHRwOi8vdGVzdGNhLmNyeXB0b3Byby5ydS9DZXJ0RW5yb2xsL0NSWVBUTy1QUk8lMjBUZXN0JTIwQ2VudGVyJTIwMigyKS5jcmwwgawGCCsGAQUFBwEBBIGfMIGcMGQGCCsGAQUFBzAChlhodHRwOi8vdGVzdGNhLmNyeXB0b3Byby5ydS9DZXJ0RW5yb2xsL3Rlc3QtY2EtMjAxNF9DUllQVE8tUFJPJTIwVGVzdCUyMENlbnRlciUyMDIoMikuY3J0MDQGCCsGAQUFBzABhihodHRwOi8vdGVzdGNhLmNyeXB0b3Byby5ydS9vY3NwL29jc3Auc3JmMAoGCCqFAwcBAQMCA0EACUCRRoLu1airiUr6cuvHQfUZCX8QPhcuFw0DacvtrFDay+kBoWLCkgCXCRwKwy+osz4XF6SezQ8aIV38+X33Xg==
      required:
        - cert
    CertVerifyResDto:
      type: object
      properties:
        status:
          type: boolean
          description: Общий результат проверки сертификата
          example: true
        isValid:
          type: boolean
          description: Результат проверки сертификата
          example: true
        isCertChainValid:
          type: boolean
          description: Результат проверки цепочки сертификатов
          example: true
        isAccreditedCA:
          type: boolean
          description: >-
            Флаг того, что сертификат выдан действующим аккредитованным
            удостоверяющим центром
          example: true
        certificate:
          type: object
          description: Информация о сертификате
          example:
            subjectFriendlyName: ESIA TEST
            issuerFriendlyName: CRYPTO-PRO Test Center 2
            subjectName: CN=ESIA TEST
            issuerName: "E=support@cryptopro.ru\r\nC=RU\r\nL=Moscow\r\nO=CRYPTO-PRO LLC\r\nCN=CRYPTO-PRO Test Center 2"
            notAfter: '2025-04-05T15:56:51.000Z'
            notBefore: '2025-02-05T15:46:51.000Z'
            serialNumber: 1200673E8B3C2E90876E4809000200673E9
            thumbprint: fd6d48cc612a0f5f9e66ce781055818a9b4500a7
            signatureAlgorithm: 1.2.643.7.1.1.3.2
            signatureDigestAlgorithm: 1.2.643.7.1.1.2.2
            publicKeyAlgorithm: 1.2.643.7.1.1.1.1
            signatureAlgorithmFriendlyName: GOST R 34.10-2012 with GOST R 34.11-2012-256
            signatureDigestAlgorithmFriendlyName: GOST R 34.11-2012-256
            publicKeyAlgorithmFriendlyName: GOST R 34.10-2012
        error:
          type: string
          description: Сообщение об ошибке
      required:
        - status
        - isValid
        - isCertChainValid
    CipherEncryptFileDto:
      type: object
      properties:
        file:
          type: string
          format: binary
          description: Файл для шифрования
        certs:
          type: array
          items:
            type: string
            format: binary
          description: Сертификаты получателей (PEM/DER)
        alg:
          type: string
          enum:
            - GOST_28147
            - GOST_R3412_2015_M
            - GOST_R3412_2015_K
            - DES3
            - AES_256
          default: GOST_R3412_2015_K
          description: Алгоритм шифрования
      required:
        - file
        - certs
    CipherEncryptReqDto:
      type: object
      properties:
        data:
          type: string
          description: Данные для шифрования в формате Base64
        certs:
          description: Сертификаты получателей в формате Base64 (PEM/DER)
          type: array
          items:
            type: string
        alg:
          type: string
          enum:
            - GOST_28147
            - GOST_R3412_2015_M
            - GOST_R3412_2015_K
            - DES3
            - AES_256
          default: GOST_R3412_2015_K
          description: Алгоритм шифрования
      required:
        - data
        - certs
    CipherEncryptResDto:
      type: object
      properties:
        encrypted:
          type: string
          description: Зашифрованные данные в формате Base64
      required:
        - encrypted
    CipherDecryptFileDto:
      type: object
      properties:
        file:
          type: string
          format: binary
          description: Зашифрованный файл (.enc)
        format:
          type: string
          enum:
            - PEM
            - DER
          default: PEM
          description: Тип кодировки
        pin:
          type: string
          description: PIN-код для доступа к закрытому ключу
          example: '1234'
      required:
        - file
    CipherDecryptReqDto:
      type: object
      properties:
        data:
          type: string
          description: Зашифрованные данные в формате Base64
        format:
          type: string
          description: Формат данных (PEM/DER)
        pin:
          type: string
          description: PIN-код для доступа к закрытому ключу
          example: '1234'
      required:
        - data
    CipherDecryptResDto:
      type: object
      properties:
        decrypted:
          type: string
          description: Расшифрованные данные в формате Base64
      required:
        - decrypted
    CipherGetRecipientsFileDto:
      type: object
      properties:
        file:
          type: string
          format: binary
          description: Зашифрованный файл (.enc)
        format:
          type: string
          enum:
            - PEM
            - DER
          default: PEM
          description: Тип кодировки
      required:
        - file
    CipherRecipientInfoDto:
      type: object
      properties:
        issuerName:
          type: string
          description: Имя издателя сертификата получателя
        serialNumber:
          type: string
          description: Серийный номер сертификата получателя
      required:
        - issuerName
        - serialNumber
    CipherGetRecipientsResDto:
      type: object
      properties:
        recipients:
          description: Список получателей зашифрованных данных
          type: array
          items:
            $ref: '#/components/schemas/CipherRecipientInfoDto'
      required:
        - recipients
    CipherGetRecipientsReqDto:
      type: object
      properties:
        data:
          type: string
          description: Зашифрованные данные в формате Base64
        format:
          type: string
          description: Формат данных (PEM/DER)
      required:
        - data
