basePath: /zdmp/api/v1
swagger: "2.0"
definitions: {}
host: 'localhost:5666'
info:
  description: API for managing certificates and self-signed CA 
  title: Secure Comms PKI API
  version: 0.0.1
paths:
  /zdmp/api/v1/ca:
    get:
      parameters:
        - in: query
          name: user
          required: true
          type: string
        - in: query
          name: password
          required: true
          type: string
        - in: query
          name: caId
          required: false
          type: string
        - in: query
          name: serialNumber
          required: false
          type: string
        - description: C Authority parameters.
          in: body
          name: body
          schema:
            properties:
              C:
                description: Certificate Data.
                type: string
              L:
                description: Certificate Data.
                type: string
              O:
                description: Certificate Data.
                type: string
              ST:
                description: Certificate Data.
                type: string
              hash_method:
                description: Certificate Data.
                type: string
      responses:
        '200':
          description: OK.
        '403':
          description: Login/pass error
      summary: Main route to manage C Authorities
      tags:
        - Manages C Authorities
    post:
      parameters:
        - in: query
          name: user
          required: true
          type: string
        - in: query
          name: password
          required: true
          type: string
        - in: query
          name: caId
          required: false
          type: string
        - in: query
          name: serialNumber
          required: false
          type: string
        - description: C Authority parameters.
          in: body
          name: body
          schema:
            properties:
              C:
                description: Certificate Data.
                type: string
              L:
                description: Certificate Data.
                type: string
              O:
                description: Certificate Data.
                type: string
              ST:
                description: Certificate Data.
                type: string
              hash_method:
                description: Certificate Data.
                type: string
      responses:
        '200':
          description: OK.
        '403':
          description: Login/pass error
      summary: Main route to manage C Authorities
      tags:
        - Manages C Authorities
    put:
      parameters:
        - in: query
          name: user
          required: true
          type: string
        - in: query
          name: password
          required: true
          type: string
        - in: query
          name: caId
          required: false
          type: string
        - in: query
          name: serialNumber
          required: false
          type: string
        - description: C Authority parameters.
          in: body
          name: body
          schema:
            properties:
              C:
                description: Certificate Data.
                type: string
              L:
                description: Certificate Data.
                type: string
              O:
                description: Certificate Data.
                type: string
              ST:
                description: Certificate Data.
                type: string
              hash_method:
                description: Certificate Data.
                type: string
      responses:
        '200':
          description: OK.
        '403':
          description: Login/pass error
      summary: Main route to manage C Authorities
      tags:
        - Manages C Authorities
  '/zdmp/api/v1/ca/info/{caId}':
    get:
      parameters:
        - in: query
          name: user
          required: true
          type: string
        - in: query
          name: password
          required: true
          type: string
        - in: path
          name: caId
          type: string
          description: Certificate identification number
          required: true
      responses:
        '200':
          description: OK.
          schema:
            properties:
              C:
                description: Certificate Data.
                type: string
              CN:
                description: Certificate Data.
                type: string
              E:
                description: Certificate Data.
                type: string
              L:
                description: Certificate Data.
                type: string
              O:
                description: Certificate Data.
                type: string
              OU:
                description: Certificate Data.
                type: string
              ST:
                description: Certificate Data.
                type: string
              hash_alg:
                description: Certificate Data.
                type: string
              id:
                description: Certificate Id.
                type: string
              status:
                description: Current status.
                type: string
        '403':
          description: Login/pass error
      summary: Get Authority details
      tags:
        - Get C Authority details
  '/zdmp/api/v1/ca/{caId}':
    delete:
      parameters:
        - in: query
          name: user
          required: true
          type: string
        - in: query
          name: password
          required: true
          type: string
        - description: Certificate identification number
          in: path
          type: string
          name: caId
          required: true
        - description: add CRLs to the certificate
          in: query
          type: boolean
          name: addCRLs
          required: false
      responses:
        '200':
          description: OK.
        '403':
          description: Login/pass error
      summary: Get a certificate of a C Authority
      tags:
        - Get a certificate of a C Authority
    get:
      parameters:
        - in: query
          name: user
          required: true
          type: string
        - in: query
          name: password
          required: true
          type: string
        - description: Certificate identification number
          in: path
          name: caId
          type: string
          required: true
        - description: add CRLs to the certificate
          in: query
          type: boolean
          name: addCRLs
          required: false
      responses:
        '200':
          description: OK.
        '403':
          description: Login/pass error
      summary: Get a certificate of a C Authority
      tags:
        - Get a certificate of a C Authority
  /zdmp/api/v1/cert:
    get:
      parameters:
        - in: query
          name: user
          required: true
          type: string
        - in: query
          name: password
          required: true
          type: string
        - in: query
          name: serverCertificate
          required: false
          type: boolean
        - in: query
          name: caId
          required: false
          type: string
        - in: query
          name: serialNumber
          required: false
          type: string
        - description: Certificate parameters.
          in: body
          name: body
          schema:
            properties:
              C:
                description: Certificate Data.
                type: string
              L:
                description: Certificate Data.
                type: string
              O:
                description: Certificate Data.
                type: string
              OU:
                description: Certificate Data.
                type: string
              SANs:
                description: Certificate Data array.
                type: string
              ST:
                description: Certificate Data.
                type: string
              ca_id:
                description: CA identifier of the certifcate.
                type: string
              hash_method:
                description: Certificate Data.
                type: string
      responses:
        '200':
          description: OK.
        '403':
          description: Login/pass error
      summary: Main route to manage certificates
      tags:
        - Manages certificates of a particular CA_Authority
    post:
      parameters:
        - in: query
          name: user
          required: true
          type: string
        - in: query
          name: password
          required: true
          type: string
        - in: query
          name: serverCertificate
          required: false
          type: boolean
        - in: query
          name: caId
          required: false
          type: string
        - in: query
          name: serialNumber
          required: false
          type: string
        - description: Certificate parameters.
          in: body
          name: body
          schema:
            properties:
              C:
                description: Certificate Data.
                type: string
              L:
                description: Certificate Data.
                type: string
              O:
                description: Certificate Data.
                type: string
              OU:
                description: Certificate Data.
                type: string
              SANs:
                description: Certificate Data array.
                type: string
              ST:
                description: Certificate Data.
                type: string
              ca_id:
                description: CA identifier of the certifcate.
                type: string
              hash_method:
                description: Certificate Data.
                type: string
      responses:
        '200':
          description: OK.
        '403':
          description: Login/pass error
      summary: Main route to manage certificates
      tags:
        - Manages certificates of a particular CA_Authority
    put:
      parameters:
        - in: query
          name: user
          required: true
          type: string
        - in: query
          name: password
          required: true
          type: string
        - in: query
          name: serverCertificate
          required: false
          type: boolean
        - in: query
          name: caId
          required: false
          type: string
        - in: query
          name: serialNumber
          required: false
          type: string
        - description: Certificate parameters.
          in: body
          name: body
          schema:
            properties:
              C:
                description: Certificate Data.
                type: string
              L:
                description: Certificate Data.
                type: string
              O:
                description: Certificate Data.
                type: string
              OU:
                description: Certificate Data.
                type: string
              SANs:
                description: Certificate Data array.
                type: string
              ST:
                description: Certificate Data.
                type: string
              ca_id:
                description: CA identifier of the certifcate.
                type: string
              hash_method:
                description: Certificate Data.
                type: string
      responses:
        '200':
          description: OK.
        '403':
          description: Login/pass error
      summary: Main route to manage certificates
      tags:
        - Manages certificates of a particular CA_Authority
  '/zdmp/api/v1/cert/info/{certId}':
    get:
      parameters:
        - in: query
          name: user
          required: true
          type: string
        - in: query
          name: password
          required: true
          type: string
        - description: Certificate identification number
          in: path
          type: string
          name: certId
          required: true
        - description: Certification Authority identification number
          in: query
          type: string
          name: caId
          required: false
      responses:
        '200':
          description: OK.
          schema:
            properties:
              Alt:
                description: Certificate Data.
                type: string
              C:
                description: Certificate Data.
                type: string
              CN:
                description: Certificate Data.
                type: string
              L:
                description: Certificate Data.
                type: string
              O:
                description: Certificate Data.
                type: string
              OU:
                description: Certificate Data.
                type: string
              ST:
                description: Certificate Data.
                type: string
              hash_alg:
                description: Certificate Data.
                type: string
              id:
                description: Certificate Id.
                type: string
              status:
                description: Current status.
                type: string
        '403':
          description: Login/pass error
      summary: Get certificate details
      tags:
        - Get certificate details
  '/zdmp/api/v1/cert/revoke/{certId}':
    get:
      parameters:
        - in: query
          name: user
          required: true
          type: string
        - in: query
          name: password
          required: true
          type: string
        - description: Certificate identification number
          in: path
          type: string
          name: certId
          required: true
        - description: Certificate Authority identification number
          in: query
          type: string
          name: caId
          required: false
      responses:
        '200':
          description: OK.
        '403':
          description: Login/pass error
      summary: Revokes a certificate
      tags:
        - Revokes a certificate
  '/zdmp/api/v1/cert/status/{certId}':
    get:
      parameters:
        - in: query
          name: user
          required: true
          type: string
        - in: query
          name: password
          required: true
          type: string
        - description: Certificate identification number
          in: path
          type: string
          name: certId
          required: true
        - description: Certificate Authorithy Identification number
          in: query
          type: string
          name: caId
          required: false
      responses:
        '200':
          description: OK.
        '403':
          description: Login/pass error
      summary: Get current status of a certificate
      tags:
        - Get or changes the status of a certificate
    put:
      parameters:
        - in: query
          name: user
          required: true
          type: string
        - in: query
          name: password
          required: true
          type: string
        - description: Certificate identification number
          in: path
          name: certId
          type: string
          required: true
        - description: Certificate Authorithy Identification number
          in: query
          type: string
          name: caId
          required: false
      responses:
        '200':
          description: OK.
        '403':
          description: Login/pass error
      summary: Get current status of a certificate
      tags:
        - Get or changes the status of a certificate
  '/zdmp/api/v1/cert/{certid}':
    delete:
      parameters:
        - in: query
          name: user
          required: true
          type: string
        - in: query
          name: password
          required: true
          type: string
        - description: Certificate identification number
          in: path
          name: certid
          type: string
          required: true
        - default: cert
          description: 'Certificate return type --> cert, key'
          in: query
          type: string
          name: resultType
        - description: Certificate Authority Identification number
          in: query
          type: string
          name: caId
          required: false
      responses:
        '200':
          description: OK.
        '403':
          description: Login/pass error
      summary: Get a certificate or private key
      tags:
        - Get or renew a certificate or private key
    get:
      parameters:
        - in: query
          name: user
          required: true
          type: string
        - in: query
          name: password
          required: true
          type: string
        - description: Certificate identification number
          in: path
          name: certid
          type: string
          required: true
        - default: cert
          description: 'Certificate return type --> cert, key'
          in: query
          type: string
          name: resultType
        - description: Certificate Authority Identification number
          in: query
          type: string
          name: caId
          required: false
      responses:
        '200':
          description: OK.
        '403':
          description: Login/pass error
      summary: Get a certificate or private key
      tags:
        - Get or renew a certificate or private key
    put:
      parameters:
        - in: query
          name: user
          required: true
          type: string
        - in: query
          name: password
          required: true
          type: string
        - description: Certificate identification number
          in: path
          name: certid
          type: string
          required: true
        - default: cert
          description: 'Certificate return type --> cert, key'
          in: query
          type: string
          name: resultType
        - description: Certificate Authority Identification number
          in: query
          type: string
          name: caId
          required: false
      responses:
        '200':
          description: OK.
        '403':
          description: Login/pass error
      summary: Get a certificate or private key
      tags:
        - Get or renew a certificate or private key
  /zdmp/api/v1/info:
    get:
      parameters:
        - in: query
          name: user
          required: true
          type: string
        - in: query
          name: password
          required: true
          type: string
        - description: Not implemented future to get options
          in: query
          type: string
          name: options
          required: true
      responses:
        '200':
          description: OK.
        '403':
          description: Login/pass error
      summary: Get a certificate of a C Authority
      tags:
        - Get a certificate of a C Authority

