![]() |
REST API
17
REST API for Luna Network HSMs
|
Add/Replace the client certificate of an already registered client with or without certificate. The certificate could be self-signed or CA signed. In the case of a CA-signed certificate, a CA certificate should be added.
The resource works in three different ways to update client's certificate:
Users with the following role privileges can perform this command:
application/vnd.safenetinc.lunasa+octet-stream;version=
application/vnd.safenetinc.lunasa+json;version=
application/vnd.safenetinc.lunasa+json;version=
Specifies the name of the client.
Use: Required
JSON Schema:
Object type: string minLength: 1 maxLength: 128 pattern: ^(?!server$)[a-zA-Z0-9_.:-]*$
Specifies the name of the client.
Use: Required
JSON Schema:
Object type: string minLength: 1 maxLength: 128 pattern: ^(?!server$)[a-zA-Z0-9_.:-]*$
The PEM-encoded certificate for the client.
Use: Required
JSON Schema:
Object
type: string
minLength: 8
maxLength: 8192
pattern: ^-{5}BEGIN CERTIFICATE-{5}(?:\s|\r|\n)([A-Za-z0-9+=/\r\n]+)-{5}END CERTIFICATE-{5}(\s|\r|\n*)$
Specifies the name of the client.
Use: Required
JSON Schema:
Object type: string minLength: 1 maxLength: 128 pattern: ^(?!server$)[a-zA-Z0-9_.:-]*$
The name of the client's certificate to be added that is uploaded in the user's home directory.
Use: Required
JSON Schema:
Object type: string minLength: 1 maxLength: 64 pattern: ^([a-zA-Z0-9_-]|[a-zA-Z0-9_.-][a-zA-Z0-9_. -]*[a-zA-Z0-9_.-])$
Success
Returned when the input data does not conform to the required validation schema.
If certificate is not valid.
If certificate is currently expired.
If client certificate update failed.
If user has not used octet-stream request for attaching file.
If user has provided restricted certificate filename.
If certificate provided does not exist.
Specified client does not exist.
Certificate Common Name contains invalid characters.
If any unexpected error occurs.
The content type of the request needs to be application/vnd.safenetinc.luna+octet-stream to notify the server that it will be receiving a file. Attach the file with the request.
Header format:
headers = {'Content-Type': "application/vnd.safenetinc.lunasa+octet-stream;version="}
PUT
https://1.2.3.4:8443/api/lunasa/ntls/clients/testClient
{ }
PUT
https://1.2.3.4:8443/api/lunasa/ntls/clients/testClient
{
"certificate": "-----BEGIN CERTIFICATE-----\n...<certificate>...\n-----END CERTIFICATE-----"
}
PUT
https://1.2.3.4:8443/api/lunasa/ntls/clients/testClient
{
"file": "10.175.76.56.pem"
}
{}