The hsm_mgmt_tool is a command-line utility for managing HSM instances, users, and keys. Crypto Officer (CO) users use it to manage HSM instances and users. Crypto User (CU) users use it to share keys and manage key attributes.
Before you run hsm_mgmt_tool commands, start hsm_mgmt_tool and log in to an HSM instance with the correct user type. For more information, see Permissions of HSM users.
Install the client
Download the HSM client package.
CentOS
Method 1: Download the HSM client package.
Method 2: Run the following command on an ECS instance that has internet access.
wget -O hsm-client-v2.03.15.10-1.x86_64.rpm 'https://yundun-hsm4.oss-ap-southeast-1.aliyuncs.com/hsm-client-v2.03.15.10-1.x86_64.rpm'Method 3: On the VSMs page, find the HSM instance and click the
icon in the Specification column.Method 4: On the Activate Cluster page, click Download HSM Management Tool.
Debian
Install the client to the /opt/hsm directory.
CentOS
sudo yum install -y hsm-client-v2.03.15.10-1.x86_64.rpmDebian
sudo dpkg -i hsm-client-2.03.15.10-20240710_1.x86_64.deb
Configure the client
Edit the servers section in the /opt/hsm/etc/hsm_mgmt_tool.cfg configuration file.
Set
nameandhostnameto the private IP address of the primary HSM.Set
owner_cert_pathto the path of the issuerCA.crt file.
Start and quit the tool
Start hsm_mgmt_tool:
/opt/hsm/bin/hsm_mgmt_tool /opt/hsm/etc/hsm_mgmt_tool.cfgQuit hsm_mgmt_tool:
cloudmgmt> quitGet help
List all available commands:
cloudmgmt> helpGet the syntax for a specific command:
cloudmgmt> help <command-name>Command reference
The following table lists all hsm_mgmt_tool commands.
Command | Description | User type |
Changes a user password on an HSM instance. Any user can change their own password. CO users can change any user's password. | CO user | |
Creates a user of any type on an HSM instance. | CO user | |
Deletes a user of any type from an HSM instance. | CO user | |
Lists the keys that a user owns or that are shared with them, along with a hash of the key ownership data for each HSM instance. | CO user, AU user | |
Gets the value of a key attribute and writes it to a file or to stdout. | CU user | |
Retrieves the certificate of an HSM instance and saves it in a specified format. | All users | |
Retrieves the certificate signing request (CSR) of an HSM instance and saves it in a specified format. | All users | |
Gets hardware information about the device that runs an HSM instance. | All users. No login required. | |
Gets a key's owner, shared users, and quorum authentication status. | CU user | |
Gets HSM instance details: IP address, hostname, port, and the current user. | All users. No login required. | |
Lists key attributes and their corresponding constant values. | All users. No login required. | |
Lists users on each HSM instance, including their user type, ID, and other attributes. | All users. No login required. | |
Logs in to or logs out from an HSM instance. | All users | |
Enters and exits the server mode for an HSM instance. | All users | |
Changes a key's label and modifies its attributes for encryption, decryption, wrapping, and unwrapping. | CU user | |
Exits hsm_mgmt_tool. | All users. No login required. | |
Shares a key with other users. | CU user | |
Stores the HSM owner certificate and the owner-signed certificate. | PRECO user or CO user |