openapi: 3.1.0
info:
  title: SCEP API
  description: SCEP API according to the RFC 8894
  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: SCEP RA Profile
  description: Interfaces used by SCEP clients to request SCEP related operations
    on top of RA Profile. SCEP Profile defines the behaviour for the specific SCEP
    configuration. SCEP Profile is bound with specific RA Profile and it can be used
    by the SCEP clients to request operations on their specific URL. These operations
    are always specific only for the RA Profile.
- name: SCEP operations
  description: "Interfaces used by SCEP clients to request SCEP related operations.\
    \ SCEP Profile defines the behaviour for the specific SCEP configuration. When\
    \ the SCEP Profile contains default RA Profile, it can be used by the SCEP clients\
    \ to request operations on their specific URL."
paths:
  /v1/protocols/scep/{scepProfileName}/pkiclient.exe:
    get:
      tags:
      - SCEP operations
      summary: SCEP Get Operations
      externalDocs:
        description: "RFC 8894, section 4.1"
        url: https://datatracker.ietf.org/doc/html/rfc8894/#section-4.1
      operationId: doGet
      parameters:
      - name: scepProfileName
        in: path
        required: true
        schema:
          type: string
      - name: operation
        in: query
        required: true
        schema:
          type: string
      - name: message
        in: query
        description: Base64 encoded CMS data
        required: false
        schema:
          type: string
          description: Base64 encoded CMS data
      responses:
        "200":
          description: Operation executed
          content:
            '*/*':
              schema:
                type: string
                format: binary
                description: "Response structure defined in RFC 8894, section 4"
        "400":
          description: Bad Request
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/ProblemDocument"
        "404":
          description: Not Found
          content:
            '*/*':
              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: []
    post:
      tags:
      - SCEP operations
      summary: SCEP Post Operations
      externalDocs:
        description: "RFC 8894, section 4.1"
        url: https://datatracker.ietf.org/doc/html/rfc8894/#section-4.1
      operationId: doPost
      parameters:
      - name: scepProfileName
        in: path
        required: true
        schema:
          type: string
      - name: operation
        in: query
        required: true
        schema:
          type: string
      requestBody:
        content:
          '*/*':
            schema:
              type: string
              format: binary
              description: Binary CMS data
        required: true
      responses:
        "200":
          description: Operation executed
          content:
            '*/*':
              schema:
                type: string
                format: binary
                description: "Response structure defined in RFC 8894, section 4"
        "400":
          description: Bad Request
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/ProblemDocument"
        "404":
          description: Not Found
          content:
            '*/*':
              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/scep/raProfile/{raProfileName}/pkiclient.exe:
    get:
      tags:
      - SCEP RA Profile
      summary: SCEP Get Operations
      externalDocs:
        description: "RFC 8894, section 4.1"
        url: https://datatracker.ietf.org/doc/html/rfc8894/#section-4.1
      operationId: doGet_1
      parameters:
      - name: raProfileName
        in: path
        required: true
        schema:
          type: string
      - name: operation
        in: query
        required: true
        schema:
          type: string
      - name: message
        in: query
        description: Base64 encoded CMS data
        required: false
        schema:
          type: string
          description: Base64 encoded CMS data
      responses:
        "200":
          description: Operation executed
          content:
            '*/*':
              schema:
                type: string
                format: binary
                description: "Response structure defined in RFC 8894, section 4"
        "400":
          description: Bad Request
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/ProblemDocument"
        "404":
          description: Not Found
          content:
            '*/*':
              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: []
    post:
      tags:
      - SCEP RA Profile
      summary: SCEP Post Operations
      externalDocs:
        description: "RFC 8894, section 4.1"
        url: https://datatracker.ietf.org/doc/html/rfc8894/#section-4.1
      operationId: doPost_1
      parameters:
      - name: raProfileName
        in: path
        required: true
        schema:
          type: string
      - name: operation
        in: query
        required: true
        schema:
          type: string
      requestBody:
        content:
          '*/*':
            schema:
              type: string
              format: binary
              description: Binary CMS data
        required: true
      responses:
        "200":
          description: Operation executed
          content:
            '*/*':
              schema:
                type: string
                format: binary
                description: "Response structure defined in RFC 8894, section 4"
        "400":
          description: Bad Request
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/ProblemDocument"
        "404":
          description: Not Found
          content:
            '*/*':
              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
