openapi: 3.1.0
info:
  title: CMP API
  description: CMP API according to the RFC 4210
  contact:
    name: ILM
    url: https://www.otilm.com
    email: info@otilm.com
  license:
    name: MIT License
    url: https://github.com/CZERTAINLY/CZERTAINLY/blob/develop/LICENSE.md
  version: 2.17.0
  x-logo:
    url: images/ilm-logo.svg
externalDocs:
  description: ILM Documentation
  url: https://docs.otilm.com
servers:
- url: https://demo.czertainly.online/api
  description: CZERTAINLY Demo server
tags:
- name: CMP RA Profile
  description: Interfaces used by CMP clients to request CMP related operations on
    top of RA Profile. CMP Profile defines the behaviour for the specific CMP configuration.
    CMP Profile is bound with specific RA Profile and it can be used by the CMP clients
    to request operations on their specific URL. These operations are always specific
    only for the RA Profile.
- name: CMP operations
  description: "Interfaces used by CMP clients to request CMP related operations.\
    \ CMP Profile defines the behaviour for the specific CMP configuration. When the\
    \ CMP Profile contains default RA Profile, it can be used by the CMP clients to\
    \ request operations on their specific URL."
paths:
  /v1/protocols/cmp/{cmpProfileName}:
    get:
      tags:
      - CMP operations
      summary: CMP Get Operations
      operationId: doGet
      parameters:
      - name: cmpProfileName
        in: path
        required: true
        schema:
          type: string
      - name: message
        in: query
        description: DER encoded CMP data
        required: false
        schema:
          type: string
          format: binary
          description: DER encoded CMP data
      responses:
        "200":
          description: CMP Operations retrieved
          content:
            '*/*':
              schema:
                type: string
                format: byte
        "500":
          description: Internal Server Error
        "400":
          description: Bad Request
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/ProblemDocument"
        "404":
          description: Not Found
          content:
            '*/*':
              schema:
                $ref: "#/components/schemas/ErrorMessageDto"
        "401":
          description: Unauthorized
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/ProblemDocument"
        "403":
          description: Forbidden
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/ProblemDocument"
      security: []
    post:
      tags:
      - CMP operations
      summary: CMP Post Operation
      externalDocs:
        description: RFC 4210
        url: https://www.rfc-editor.org/rfc/rfc4210
      operationId: doPost
      parameters:
      - name: cmpProfileName
        in: path
        required: true
        schema:
          type: string
      requestBody:
        content:
          application/pkixcmp:
            schema:
              type: string
              format: binary
              description: Binary CMP data
        required: true
      responses:
        "200":
          description: Operation executed
          content:
            application/pkixcmp:
              schema:
                type: string
                format: binary
                description: "Response structure(s) defined in RFC 4210, section 5.3"
                externalDocs:
                  description: RFC 4210
                  url: https://www.rfc-editor.org/rfc/rfc4210#section-5.3
        "400":
          description: Bad Request
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/ProblemDocument"
        "404":
          description: Not Found
          content:
            application/pkixcmp:
              schema:
                $ref: "#/components/schemas/ErrorMessageDto"
        "500":
          description: Internal Server Error
        "401":
          description: Unauthorized
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/ProblemDocument"
        "403":
          description: Forbidden
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/ProblemDocument"
      security: []
  /v1/protocols/cmp/raProfile/{raProfileName}:
    get:
      tags:
      - CMP RA Profile
      summary: CMP Get Operations
      operationId: doGet_1
      parameters:
      - name: raProfileName
        in: path
        required: true
        schema:
          type: string
      - name: message
        in: query
        description: DER encoded CMP data
        required: false
        schema:
          type: string
          format: binary
          description: DER encoded CMP data
      responses:
        "200":
          description: CMP Operations retrieved
          content:
            '*/*':
              schema:
                type: string
                format: byte
        "500":
          description: Internal Server Error
        "400":
          description: Bad Request
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/ProblemDocument"
        "404":
          description: Not Found
          content:
            '*/*':
              schema:
                $ref: "#/components/schemas/ErrorMessageDto"
        "401":
          description: Unauthorized
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/ProblemDocument"
        "403":
          description: Forbidden
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/ProblemDocument"
      security: []
    post:
      tags:
      - CMP RA Profile
      summary: CMP Post Operation
      externalDocs:
        description: RFC 4210
        url: https://www.rfc-editor.org/rfc/rfc4210
      operationId: doPost_1
      parameters:
      - name: raProfileName
        in: path
        required: true
        schema:
          type: string
      requestBody:
        content:
          application/pkixcmp:
            schema:
              type: string
              format: binary
              description: Binary CMP data
        required: true
      responses:
        "200":
          description: Operation executed
          content:
            application/pkixcmp:
              schema:
                type: string
                format: binary
                description: "Response structure(s) defined in RFC 4210, section 5.3"
                externalDocs:
                  description: RFC 4210
                  url: https://www.rfc-editor.org/rfc/rfc4210#section-5.3
        "400":
          description: Bad Request
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/ProblemDocument"
        "404":
          description: Not Found
          content:
            application/pkixcmp:
              schema:
                $ref: "#/components/schemas/ErrorMessageDto"
        "500":
          description: Internal Server Error
        "401":
          description: Unauthorized
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/ProblemDocument"
        "403":
          description: Forbidden
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/ProblemDocument"
      security: []
components:
  schemas:
    ErrorMessageDto:
      type: object
      properties:
        message:
          type: string
          description: Error message detail
          examples:
          - Error message
      required:
      - message
    ProblemDocument:
      type: object
      properties:
        type:
          type: string
          description: Type of the ACME problem
          examples:
          - notFound
        title:
          type: string
          description: ACME problem title
          examples:
          - Not Found
        detail:
          type: string
          description: ACME problem details
          examples:
          - Requested object is not found
        instance:
          type: string
          description: URL of the changes if something needs to be approved
          examples:
          - https://some-company.com/instances/changes
        subproblems:
          type: array
          description: List of subproblems related to error
          items:
            $ref: "#/components/schemas/ProblemDocument"
        algorithms:
          type: array
          description: List of supported algorithms
          example:
          - ES256
          items:
            type: string
      required:
      - detail
      - instance
      - type
