Test HSM Connectivity
post
/api/v1/blockchainPlatforms/hsm/check
Tests HSM connectivity from each specified host.
Request
Supported Media Types
- application/json
Details required to communicate with the HSM
Root Schema : TestHsmPayload
Type:
object
Details required to communicate with the HSM
Show Source
-
hsmConfiguration:
object HSMDetails
Details required to communicate with the HSM.
-
platformHosts:
array platformHosts
A list of host names or IP addresses of the VMs to test from. The list must be IP addresses if a VM has multiple IP addresses. The list must include the component manager VM.
Nested Schema : HSMDetails
Type:
object
Details required to communicate with the HSM.
Show Source
-
chrystokiConf:
string
The path to the Chrystoki.conf file.
-
label:
string
The partition label to use in the HSM.
-
library:
string
The path for the libCryptoki2.so library.
-
pin:
string
The Crypto Officer PIN for the partition in the HSM.
Nested Schema : platformHosts
Type:
array
A list of host names or IP addresses of the VMs to test from. The list must be IP addresses if a VM has multiple IP addresses. The list must include the component manager VM.
Show Source
Response
Supported Media Types
- application/json
200 Response
OK
400 Response
Bad Request
Root Schema : Error
Type:
object
Error Information.
Show Source
-
errors(optional):
array errors
list of errors
-
message:
string
A human-readable error string.
-
status:
string
A short error status that defines the error, meant for programmatic parsing.
-
warnings(optional):
array warnings
list of warnings
401 Response
Unauthorized
Root Schema : Error
Type:
object
Error Information.
Show Source
-
errors(optional):
array errors
list of errors
-
message:
string
A human-readable error string.
-
status:
string
A short error status that defines the error, meant for programmatic parsing.
-
warnings(optional):
array warnings
list of warnings
404 Response
Not Found
Root Schema : Error
Type:
object
Error Information.
Show Source
-
errors(optional):
array errors
list of errors
-
message:
string
A human-readable error string.
-
status:
string
A short error status that defines the error, meant for programmatic parsing.
-
warnings(optional):
array warnings
list of warnings
409 Response
Operation conflict
Root Schema : Error
Type:
object
Error Information.
Show Source
-
errors(optional):
array errors
list of errors
-
message:
string
A human-readable error string.
-
status:
string
A short error status that defines the error, meant for programmatic parsing.
-
warnings(optional):
array warnings
list of warnings
Examples
The following example shows how to test connectivity to a hardware security module (HSM) by submitting a POST request on the REST resource using cURL.
curl -X POST -u <username>:<password> -k \ "http://<rest_server_url>:port/api/v1/blockchainPlatforms/hsm/check" \ -H "accept: application/json" \ -H "Content-Type: application/json" \ --data @<JSON file with the request parameters>
For example,
curl -X POST -u <username>:<password> -k \ "http://<rest_server_url>:port/api/v1/blockchainPlatforms/hsm/check" \ -H "accept: application/json" \ -H "Content-Type: application/json" \ --data @file.json
The contents of file.json
are:
{ "platformHosts":["vm1.example.com"], "hsmConfiguration": { "library":"/etc/hyperledger/fabric/dpod/fabric/libs/64/libCryptoki2.so", "label":"fabric", "pin":"PasswordPO1", "chrystokiConf":"/etc/hyperledger/fabric/dpod/fabric/" } }
Where each parameter in the payload file represents:
Table - Payload Parameters
Parameter | Purpose | Possible Values |
---|---|---|
platformHosts |
List of virtual machines (VMs) to test from | An array of host names or IP addresses. If a VM has multiple IP addresses, the list must be IP addresses. The list must include the component manager VM. |
library |
Cryptography library file | The path to the libCryptoki2 library file. |
label |
Partition label | The label of the partition to test in the HSM. |
pin |
Crypto Officer PIN | The Crypto Officer PIN for the partition to test in the HSM. |
chrystokiConf |
Configuration file | The path to the Chrystoki.conf file. |
Example of the Response Body
The following example shows the contents of the response body in JSON format:
{ "status": "200", "message": "HSM connectivity verified" }