/api/v1/pki/cas:
  get:
    summary: Get PKI Certificate Authorities.
    responses:
      '200':
        $ref: '#/components/responses/PkiCasList'
      '401':
        $ref: '#/components/responses/Unauthorized'
    tags:
      - PKI
  post:
    summary: Create PKI Certificate Authority.
    requestBody:
      $ref: '#/components/requestBodies/PkiCa'
    responses:
      '200':
        $ref: '#/components/responses/PkiCaCreate'
      '401':
        $ref: '#/components/responses/Unauthorized'
      '404':
        $ref: '#/components/responses/BadRequest'
      '422':
        $ref: '#/components/responses/UnprocessableEntity'
      '500':
        $ref: '#/components/responses/BadRequest'
    tags:
      - PKI

/api/v1/pki/cas/search:
  post:
    summary: Search PKI Certificate Authorities.
    requestBody:
      $ref: '#/components/requestBodies/PkiCasSearch'
    responses:
      '200':
        $ref: '#/components/responses/PkiCasSearch'
      '401':
        $ref: '#/components/responses/Unauthorized'
      '404':
        $ref: '#/components/responses/BadRequest'
      '422':
        $ref: '#/components/responses/UnprocessableEntity'
      '500':
        $ref: '#/components/responses/BadRequest'
    tags:
      - PKI

/api/v1/pki/ca/{ca_id}:
  get:
    summary: Get PKI Certificate Authority.
    parameters:
      - name: ca_id
        in: path
        required: true
        description: '`PRIMARY KEY`'
        schema:
          type: string
    responses:
      '200':
        $ref: '#/components/responses/PkiCa'
      '401':
        $ref: '#/components/responses/Unauthorized'
    tags:
      - PKI
  patch:
    summary: Update Certificate Authority Public Key.
    parameters:
      - name: ca_id
        in: path
        required: true
        description: '`PRIMARY KEY`'
        schema:
          type: string
    requestBody:
      $ref: '#/components/requestBodies/PkiCaCertOnly'
    responses:
      '200':
        $ref: '#/components/responses/PkiCa'
      '401':
        $ref: '#/components/responses/Unauthorized'
    tags:
      - PKI

/api/v1/pki/ca/resign/{ca_id}:
  post:
    summary: Re-Sign PKI Certificate Authority.
    requestBody:
      $ref: '#/components/requestBodies/PkiCa'
    parameters:
      - name: ca_id
        in: path
        required: true
        description: '`PRIMARY KEY`'
        schema:
          type: string
    responses:
      '200':
        $ref: '#/components/responses/PkiCasList'
      '401':
        $ref: '#/components/responses/Unauthorized'
    tags:
      - PKI

/api/v1/pki/ca/csr/{ca_id}:
  post:
    summary: Generate Certificate Signing Request.
    requestBody:
      $ref: '#/components/requestBodies/PkiCa'
    parameters:
      - name: ca_id
        in: path
        required: true
        description: '`PRIMARY KEY`'
        schema:
          type: string
    responses:
      '200':
        $ref: '#/components/responses/PkiCasList'
      '401':
        $ref: '#/components/responses/Unauthorized'
    tags:
      - PKI
