![]() |
REST API
16
REST API for Luna Network HSMs
|
Verify or Update a secure package on appliances. This resource supports url query string. If user does not use OpenSSL EVP, you need HSM SO authentication.
The resource works in two different ways:
Users with the following role privileges can perform this command:
This query string specifies if this request is only to verify the package. When the value is set to "true", only verification is performed. Otherwise, the package will be verified and updated on appliances.
application/vnd.safenetinc.lunasa+multipart;version=
Note: Before calling this API, it is advised to check maxFileSize using GET /api/lunasa/webServer and update via PATCH /api/lunasa/webServer based on the file size.
application/vnd.safenetinc.lunasa+json;version=
This parameter specifies the authcode of the secure package. Each secure package should have its own authcode for verification or update purpose.
Use: Required
JSON Schema:
Object type: string minLength: 16 maxLength: 16 pattern: [A-Za-z0-9/]
This parameters specifies if DES3 Cipher is used for package update or verify. It cannot be used simultaneously with EVP.
Use: Not Required
JSON Schema:
Object type: boolean
This parameters specifies if OpenSSL EVP is used to decrypt and validate the package. If so, SO authentication is not required. It cannot be used simultaneously with Des3.
Use: Not Required
JSON Schema:
Object type: boolean
This parameter specifies the authcode of the secure package. Each secure package should have its own authcode for verification or update purpose.
Use: Required
JSON Schema:
Object type: string minLength: 16 maxLength: 16 pattern: [A-Za-z0-9/]
The name of the update package file that should be uploaded in user's home directory.
Use: Required
JSON Schema:
Object type: string minLength: 1 maxLength: 64 pattern: [a-zA-Z0-9_. -]
This parameters specifies if DES3 Cipher is used for package update or verify. It cannot be used simultaneously with EVP.
Use: Not Required
JSON Schema:
Object type: boolean
This parameters specifies if OpenSSL EVP is used to decrypt and validate the package. If so, SO authentication is not required. It cannot be used simultaneously with Des3.
Use: Not Required
JSON Schema:
Object type: boolean
No Content, Success.
If operation fails
If HSM SO has not logged in
If user use both EVP and DES3
If user has provided restricted package name.
If user has not used multipart request for attaching file.
Critical Operation currently in Progress.
If package provided does not exist
If package size is larger than configured maxFileSize. Refer GET /api/lunasa/webServer
The content type of the request needs to be application/vnd.safenetinc.luna+multipart. Here is an example of sending such a request using python library requests.
import requests
import os
import json
payload = {"authCode": "x7JTA/KPqJd56xY7", "useEvp": False, "useDes3": False}
files = { 'json': (None, json.dumps(payload), 'application/json') 'file': (None, open("pathToSecurePackageFile", 'rb'), 'appliaction/octet-stream') }
headers = {'content-type': 'application/vnd.safenetinc.luna+multipart;version=6'}
r = requests.request("POST", "https://1.2.3.4:8443/api/lunasa/packageFiles?VerifyOnly=false", files=files,headers=headers, verify=False)
POST https://1.2.3.4:8443/api/lunasa/packageFiles?VerifyOnly=false { "authCode":"5ERd79MAGdHG9EY5", "file":"lunasa_update-7.1.0.spkg" }
Result may also be a task.
{ }
Note: Before calling this API for multipart request, it is advised to check maxFileSize using GET /api/lunasa/webServer and update via PATCH /api/lunasa/webServer based on the file size.