hsm_mgmt_tool
The hsm_mgmt_tool command-line tool lets CO users manage HSM instances and HSM users, and lets CU users share keys and get and set key attributes.
Before you run hsm_mgmt_tool commands, you must start hsm_mgmt_tool and log in to an HSM instance. Ensure that you log in with the correct user type. For details, see HSM User Permission Table.
Download the installation package
Download the HSM instance management tool.
CentOS
Method 1: Download the HSM instance management tool.
Method 2: Run the following command to download the HSM instance management tool. This operation requires your ECS instance to have public network 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 target HSM instance and click the
icon in the Specification column.Method 4: On the Activate Cluster page, click Download the HSM instance management tool.
Debian
Visit hsm-client-2.03.15.10-20240710_1.x86_64.deb to download the HSM instance management tool.
Run the following command to install the client and its configuration file 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
Modify the configuration file
Modify the servers parameter in the /opt/hsm/etc/hsm_mgmt_tool.cfg configuration file.
Change name and hostname to the private IP address of the primary HSM.
Change owner_cert_path to the file path of issuerCA.crt.
Start and quit the tool
Start the hsm_mgmt_tool command-line tool.
/opt/hsm/bin/hsm_mgmt_tool /opt/hsm/etc/hsm_mgmt_tool.cfgQuit the hsm_mgmt_tool command-line tool.
cloudmgmt> quitGet help
Run the following command to list all hsm_mgmt_tool commands.
cloudmgmt> helpRun the following command to get the syntax for a specific hsm_mgmt_tool command.
cloudmgmt> help <command-name>Command reference
The hsm_mgmt_tool provides the following commands:
Command | Description | User type |
Changes a user's password on an HSM instance. All users can change their own password. A CO user can change any user's password. | CO user | |
Creates users of all types on an HSM instance. | CO user | |
Deletes users of all types from an HSM instance. | CO user | |
Gets the keys owned by or shared with a user. It also returns a hash of the key ownership and data for all keys on each HSM instance. | CO user, AU user | |
Gets the value of an attribute of an HSM key and writes it to a file or standard output (stdout). | CU user | |
Gets the certificate of a specific HSM instance and saves it in a specified format. | All users | |
Gets the certificate request of a specific HSM instance and saves it in a specified format. | All users | |
Gets information about the device on which an HSM instance runs. | All users. No login required. | |
Gets a key's owner, shared users, and quorum authentication status. | CU user | |
Gets information about an HSM instance, including its IP address, hostname, port, and the current user. | All users. No login required. | |
Lists the attributes of an HSM key and the constants that represent them. | All users. No login required. | |
Gets the users in each HSM instance, along with their user type, ID, and other attributes. | All users. No login required. | |
Logs into and out of 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 | |
Quits hsm_mgmt_tool. | All users. No login required. | |
Shares an existing key with other users. | CU user | |
Stores the HSM owner certificate and the owner-signed certificate. | PRECO user or CO user |