Test HSM Connectivity

post

/api/v1/blockchainPlatforms/hsm/check

Tests HSM connectivity from each specified host.

Request

Supported Media Types
Body ()
Details required to communicate with the HSM
Root Schema : TestHsmPayload
Type: object
Details required to communicate with the HSM
Show Source
Nested Schema : HSMDetails
Type: object
Details required to communicate with the HSM.
Show Source
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
Back to Top

Response

Supported Media Types

200 Response

OK

400 Response

Bad Request
Body ()
Root Schema : Error
Type: object
Error Information.
Show Source
Nested Schema : errors
Type: array
list of errors
Show Source
Nested Schema : warnings
Type: array
list of warnings
Show Source

401 Response

Unauthorized
Body ()
Root Schema : Error
Type: object
Error Information.
Show Source
Nested Schema : errors
Type: array
list of errors
Show Source
Nested Schema : warnings
Type: array
list of warnings
Show Source

404 Response

Not Found
Body ()
Root Schema : Error
Type: object
Error Information.
Show Source
Nested Schema : errors
Type: array
list of errors
Show Source
Nested Schema : warnings
Type: array
list of warnings
Show Source

409 Response

Operation conflict
Body ()
Root Schema : Error
Type: object
Error Information.
Show Source
Nested Schema : errors
Type: array
list of errors
Show Source
Nested Schema : warnings
Type: array
list of warnings
Show Source
Back to Top

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"
}
Back to Top