HSM Work uses SoftHSM2 as its token backend, which fully implements the PKCS#11 interface. All key material is stored in software and is suitable for development and testing environments.
Components
hls-hsm
A C++17 library that wraps common HSM operations — RSA key generation, AES key generation, random byte generation, and key retrieval — behind a clean
HSM class interface.pkcs11-daemon
A long-running C++ daemon that manages a SQLite-backed key vault, auto-imports keys from SD card ports, and initializes both RSA and post-quantum (Dilithium) keys on startup.
SoftHSM2 integration
Shell tooling and scripts that interface with SoftHSM2 via
pkcs11-tool for token initialization, RSA key pair generation, signing, and signature verification.Architecture
System requirements
| Requirement | Details |
|---|---|
| Operating system | Linux (Debian/Ubuntu recommended) |
| SoftHSM2 | Token backend for PKCS#11 operations |
| OpenSC / pkcs11-tool | PKCS#11 command-line interface |
| OpenSSL | Public key export and signature verification |
| liboqs | Post-quantum cryptography (Dilithium) for pkcs11-daemon |
| SQLite3 | Key vault storage for pkcs11-daemon |
| CMake | 3.20 or later |
| Compiler | gcc/g++ with C++17 support |
The
pkcs11-daemon component depends on liboqs for post-quantum key generation (Crypto::pqc_generate()). If you only need the hls-hsm library and SoftHSM2 signing workflow, liboqs is not required.Next steps
Quickstart
Install prerequisites and complete a full sign and verify workflow in under 10 minutes.
hls-hsm library
Explore the C++ HSM class, its methods, and how to integrate it into your build with CMake.
pkcs11-daemon
Learn how the daemon manages key storage, SD card import, and post-quantum key initialization.
Sign and verify
Detailed reference for the
hsm_sign_verify.sh script and manual signing workflows.