Command line tool for YubiHSM 2. This is a work in progress and is currently not supported and not part of the official YubiHSM SDK
YubiHSM Manger is mainly used to manage asymmetric and symmetric keys, authentication keys and wrap keys as well as setting up the YubiHSM2 for specific usecases.
Use this tool instead of yubihsm-setup. Use Space key to select and deselect options in multi-choice questions. Use ESC key to cancel current operation.
To build the tool a normal Rust toolchain is required, stable Rust will suffice.
The tools uses the yubihsmrs crate as obtained from https://github.com/Yubico/yubihsmrs/tree/yubihsm-manager (note
the yubihsm-manager branch), which in turn requires libyubihsm to be available.
Set the environment variable YUBIHSM_LIB_DIR to point to the directory containing the libyubihsm library then run:
$ cargo buildSet the environment variable LD_LIBRARY_PATH to point to the directory containing the libyubihsm library then run:
$ cargo runOr
$ ./target/debug/yubihsm-managerNote that on Windows, the libyubihsm.dll need to be in PATH
To run automated test that do not require a YubiHSM device to be connected, run:
$ cargo testTo run tests that require a YubiHSM device to be connected, and run:
$ cargo test --features device-tests -- --test-threads=1Note that the test-threads needs to be set to 1 because only one operation can be run in the YubiHSM at a time.
To run individual tests, run:
$ cargo test <TEST_NAME>or for tests that require a YubiHSM device to be connected, run:
$ cargo test --features device-tests -- --test-threads=1 <TEST_NAME>where TEST_NAME is the path to the test. For example common::validators or hsm_operations::tests::wrap_tests
Copyright 2025 Yubico AB Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.