REST API  17
REST API for Luna Network HSMs
PATCH /api/lunasa/ntls/certificate

PATCH /api/lunasa/ntls/certificate

Regenerates a private key and self-signed NTLS certificate with the given amount of fields.

User Privileges

Users with the following role privileges can perform this command:

  • admin

Parameters

cn

cn is the common name that will be configured as part of the certificate signing request. The default common name is device's hostname.

Use: Not Required

JSON Schema:

   Object
   type: string
   minLength: 1
   maxLength: 64
   pattern: ^[a-zA-Z0-9]([a-zA-Z0-9.-]{0,62}[a-zA-Z0-9])?$

startDate

Specify the certificate start date. The default date is the device's date.

Use: Not Required

JSON Schema:

   Object
   type: string
   format: date
   minLength: 10
   maxLength: 10
   pattern: ^[0-9]{4}-[0-1]{1}[0-9]{1}-[0-3]{1}[0-9]{1}$

days

Specify the duration of certificate. The default duration of certificate is 3653 days.

Use: Not Required

JSON Schema:

   Object
   type: integer
   minimum: 1
   maximum: 3653

country

Two-letter code of the country where the organization is located.

Use: Not Required

JSON Schema:

   Object
   type: string
   minLength: 2
   maxLength: 2
   pattern: ^[A-Z]*$

state

State in which the organization is located.

Use: Not Required

JSON Schema:

   Object
   type: string
   minLength: 1
   maxLength: 64
   pattern: ^[A-Za-z](?:[A-Za-z0-9 _]*[A-Za-z0-9_])?$

location

City in which the organization is located.

Use: Not Required

JSON Schema:

   Object
   type: string
   minLength: 1
   maxLength: 64
   pattern: ^[A-Za-z](?:[A-Za-z0-9 _.-]*[A-Za-z0-9_.-])?$

organization

The full legal name of the organization.

Use: Not Required

JSON Schema:

   Object
   type: string
   minLength: 1
   maxLength: 64
   pattern: ^[A-Za-z](?:[A-Za-z0-9 _]*[A-Za-z0-9_])?$

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 _]*[A-Za-z0-9_])?$

email

Email address used to contact the owner.

Use: Not Required

JSON Schema:

   Object
   type: string
   format: email
   minLength: 3
   maxLength: 128
   pattern: ^[a-zA-Z0-9_.%+-]+@[a-zA-Z0-9.-]+.[a-zA-Z]{2,}$

subjectAltNames

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

Use: Not Required

JSON Schema:

   Object
   type: array
      subjectAltName: object
      type: string
      minLength: 1
      maxLength: 64
      minItems: 1
      maxItems: 10
      pattern: ^((IP|DNS):[a-zA-Z0-9_.-]+)$

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
   minLength: 3
   maxLength: 3
   pattern: ^(rsa|ecc)$

curveName

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

Use: Not Required

JSON Schema:

   Object
   type: string
   minLength: 9
   maxLength: 10
   pattern: ^(secp256k1|secp384r1|secp521r1|prime256v1)$

dcComponents

Represents the Domain Components (DC) in the certificate's subject.

Use: Not Required

JSON Schema:

   Object
   type: array
      dcComponents: Object
      type: string
      minLength: 1
      maxLength: 64
      minItems: 1
      maxItems: 10
      pattern: ^[a-zA-Z0-9_.-]*$

Responses

204

Success

Location

JSON Schema:

    id: Object
        type: string

"Location" is the URL to the task spawned to regenerate the certificate. The task is a waiting task.

400

FRAMEWORK_BAD_REQUEST

Returned when the input data does not conform to the required validation schema.

422

FRAMEWORK_UNPROCESSABLE_ENTITY

Request could not be processed due to semantic errors.

500

NTLS_FAILED_TO_GENERATE_CERTIFICATE

Failed to generate a certificate.

Example Request

   PATCH
   https://1.2.3.4:8443/api/lunasa/ntls/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"],
      "dcComponents": ["example", "com"],
      "keySize" : 2048,
      "keyType": "rsa"
   }

Example Result

{
}