REST API  15
REST API for Luna Network HSMs
PATCH /api/lunasa/syslog/remoteHosts/certificate

PATCH /api/lunasa/syslog/remoteHosts/certificate

Generates a private key and self-signed HSM certificate.

Note: The syslog service needs to be (re)started before a secure connection can be established.

User Privileges

Users with the following role privileges can perform this command:

  • admin
  • operator

Parameters

cn

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

Use: Not Required

JSON Schema:

   Object
   type: string
   minLength: 1
   maxLength: 64
   pattern: ^[a-zA-Z0-9 '()+,.\\\\/:=?-]*$

startDate

Specify the certificate start date.

Use: Not Required

JSON Schema:

   Object
   type: string
   pattern: ^pattern: ^\d{4}-[0-1]{1}\d{1}-[0-3]{1}\d{1}$$

days

Specify the duration of CSR. Default value is 3653.

Use: Not Required

JSON Schema:

   Object
   type: integer
   minValue: 1
   maxValue: 3653

country

Two-letter code of the country where the organization is located. Default value is "CA".

Use: Not Required

JSON Schema:

   Object
   type: string
   minLength: 2
   maxLength: 2
   pattern: ^(A-Z){2}$

state

State in which the organization is located. Default value is "Ontario".

Use: Not Required

JSON Schema:

   Object
   type: string
   minLength: 1
   maxLength: 64
   pattern: ^[a-zA-Z][a-zA-Z0-9_]{0,63}$

location

City in which the organization is located. Default value is "Ottawa".

Use: Not Required

JSON Schema:

   Object
   type: string
   minLength: 1
   maxLength: 64
   pattern: ^[a-zA-Z][a-zA-Z0-9_.-]{0,63}$

organization

The full legal name of the organization. Default value is "Thales".

Use: Not Required

JSON Schema:

   Object
   type: string
   minLength: 1
   maxLength: 64
   pattern: ^[a-zA-Z][a-zA-Z0-9_]{0,63}$

orgunit

Division of the organization.

Use: Not Required

JSON Schema:

   Object
   type: string
   minLength: 1
   maxLength: 64
   pattern: ^[a-zA-Z][a-zA-Z0-9_]{0,63}$

email

Email address used to contact the owner.

Use: Not Required

JSON Schema:

   Object
   type: string
   minLength: 3
   maxLength: 128
   Pattern: ^(\\\\w+)(\\\\.|_)?(\\\\w*)@(\\\\w+)(\\\\.(\\\\w+))+$

subjectAltNames

In addition to FQDN, when intended to support other subdomains.

Use: Not Required

JSON Schema:

   Object
   type: array
      subjectAltName: Obect
      type: string
      minLength: 1
      maxLength: 64
      pattern: ^((IP|DNS):[a-zA-Z0-9_.-]{0,63}){1,10}(,(IP|DNS):[a-zA-Z0-9_.-]{0,63}){0,10}$

keySize

Size of the key. Valid sizes are 2048, 3072 and 4096. Default keySize is 2048 when keyType is "rsa".

Use: Not Required

JSON Schema:

   Object
   type: integer

keyType

Type of the key. Valid values are "rsa" and "ecc". Default type is "rsa".

Use: Not Required

JSON Schema:

   Object
   type: string

curveName

Elliptical curve name. Valid values are "secp256k1", "secp384r1", "secp521r1" and "prime256v1". Default is "secp384r1".

Use: Not Required

JSON Schema:

   Object
   type: string

Responses

204

Successful.

400

FRAMEWORK_BAD_REQUEST

We failed to parse your request.

500

SYSLOG_INTERNAL_ERROR

Operation has not completed successfully.

Example Request

   PATCH
   https://1.2.3.4:8443/api/lunasa/syslog/remoteHosts/certificate
   {
      "cn": "1.2.3.5",
      "startDate": "2024-02-12",
      "days": 30,
      "country": "CA",
      "state": "Ontario",
      "location": "Ottawa",
      "organization": "Thales",
      "orgunit" : "GPHSM",
      "email": "sample@email.com",
      "subjectAltNames" : ["IP:1.2.3.4", "DNS:example.com"],
      "keySize" : 2048,
      "keyType": "rsa"
   }

Example Result

{'Access-Control-Allow-Origin': '*', 'Content-Type': 'application/json', 'Location': '/tasks/0', 'Content-Length': '251', 'Access-Control-Allow-Credentials': 'true'}

{
}

Example Request

   PATCH
   https://1.2.3.4:8443/api/lunasa/syslog/remoteHosts/certificate
   {
      "cn": "1.2.3.5",
      "startDate": "2024-02-12",
      "days": 30,
      "country": "CA",
      "state": "Ontario",
      "location": "Ottawa",
      "organization": "Thales",
      "orgunit" : "GPHSM",
      "email": "sample@email.com",
      "subjectAltNames" : ["IP:1.2.3.4", "DNS:example.com"],
      "keyType": "ecc",
      "curveName" : "secp384r1"
   }

Example Result

{'Access-Control-Allow-Origin': '*', 'Content-Type': 'application/json', 'Location': '/tasks/0', 'Content-Length': '251', 'Access-Control-Allow-Credentials': 'true'}

{
}