REST API
15
REST API for Luna Network HSMs
|
Generates a certificate signing request for the webserver's certificate.
curveName is the elliptic curve used for an ECDSA-based certificate that will be configured as part of the certificate signing request.
Use: Not Required
JSON Schema:
Object type: string
keyType is the type of key that will be configured as part of the certificate signing request.
Use: Required
JSON Schema:
Object type: string
keySize is the number of bits for the key that will be configured as part of the certificate signing request.
Use: Required
JSON Schema:
Object type: int
cn is the common name that will be configured as part of the certificate signing request.
Use: Required
JSON Schema:
Object type: string
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 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 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 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 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 is the email that will be configured as part of the certificate signing request's subject.
Use: Not Required
JSON Schema:
Object type: string
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 is the starting date that will be configured as part of the certificate signing request.
Use: Not Required
JSON Schema:
Object type: string
days is the duration that will be configured as part of the certificate signing request.
Use: Not Required
JSON Schema:
Object type: string
Data buffer containing the file contents.
Unexpected error
POST https://1.2.3.4:8443/api/lunasa/webServer/csr { "keyType" : "rsa", "keySize" : 2048, "subjectAltNames" : ["example.com", "www.example.com"], "cn" : "1.2.3.4", "startDate" : "2020-11-20", "days" : 365 }
{ }
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/webServer/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()