REST API  15
REST API for Luna Network HSMs
All Files Pages
POST /api/lunasa/ntls/csr

POST /api/lunasa/ntls/csr

Generates a certificate signing request for the NTLS certificate.

Parameters

cn

cn is the common name that will be configured as part of the certificate signing request.

Use: Required

JSON Schema:

   Object
   type: string

country

country is the country that will be configured as part of the certificate signing request's subject.

Use: Not Required

JSON Schema:

   Object
   type: string

state

state is the state that will be configured as part of the certificate signing request's subject.

Use: Not Required

JSON Schema:

   Object
   type: string

location

location is the location that will be configured as part of the certificate signing request's subject.

Use: Not Required

JSON Schema:

   Object
   type: string

organization

organization is the organization that will be configured as part of the certificate signing request's subject.

Use: Not Required

JSON Schema:

   Object
   type: string

orgunit

orgunit is the organization unit that will be configured as part of the certificate signing request's subject.

Use: Not Required

JSON Schema:

   Object
   type: string

email

email is the email that will be configured as part of the certificate signing request's subject.

Use: Not Required

JSON Schema:

   Object
   type: string

subjectAltNames

subjectAltName is the array of alternate names that will be configured as part of the certificate signing request's subject.

Use: Not Required

JSON Schema:

   Object
   type: array
      subjectAltName: Obect
      type: string

startDate

startDate is the starting date that will be configured as part of the certificate signing request.

Use: Not Required

JSON Schema:

   Object
   type: string

days

days is the duration that will be configured as part of the certificate signing request.

Use: Not Required

JSON Schema:

   Object
   type: string

Responses

200

Data buffer containing the file contents.

400

Unexpected error

Example Request

   POST
   https://1.2.3.4:8443/api/lunasa/ntls/csr

   {
   "cn" : "1.2.3.4",
   "startDate" : "2020-11-20",
   "days" : 365
   }

Example Result

{

}

Notes

This resource returns the contents of a file in a buffer.

Below is an example of getting the contents in python. We iterate through the contents and save them to a file.

        r = requests.post("/api/lunasa/ntls/csr",
                         stream=True,
                         cookies=cookies,
                         verify=False,
                         allow_redirects=False,
                         data=payload)

        with open("ssl.csr", 'wb') as csr:
          for chunk in r.iter_content(chunk_size=1024):
              if chunk:
                  csr.write(chunk)
          csr.close()