Skip to main content
SoftHSM v2 ships two low-level inspection tools for dumping token contents to stdout. They are intended for debugging and are not required for normal operation.
ToolObject store typeInput
softhsm2-dump-fileFile-based object storePath to a single object file
softhsm2-dump-dbSQLite3 database object storePath to a .db database file
SoftHSM v2 supports two storage backends: a file-based store (one file per object) and a SQLite3 database store. Use the tool that matches the backend configured for your installation.

softhsm2-dump-file

Dumps a SoftHSM v2 object file from the file-based object store.
softhsm2-dump-file path

Arguments

path
string
required
Path to the SoftHSM v2 object file to dump. Object files are stored in the token directory defined in softhsm2.conf and have names like <uuid>.object.
softhsm2-dump-file takes exactly one positional argument — the path — and no flags.

Example

softhsm2-dump-file /var/lib/softhsm/tokens/abc123.../b7e9f2a1-aaaa-bbbb-cccc-111111111111.object

softhsm2-dump-db

Dumps a SoftHSM v2 SQLite3 database from the database-backed object store.
softhsm2-dump-db path

Arguments

path
string
required
Path to the SoftHSM v2 SQLite3 database file to dump. The database file is named sqlite3.db and is located inside the token’s UUID subdirectory in directories.tokendir.
softhsm2-dump-db takes exactly one positional argument — the path — and no flags.

Example

softhsm2-dump-db /var/lib/softhsm/tokens/550e8400-e29b-41d4-a716-446655440000/sqlite3.db

Debugging workflow

1

Identify your storage backend

Check your softhsm2.conf to determine whether you are using the file-based or SQLite3 backend, and locate the token directory.
2

Locate the object store

For the file backend, navigate to the token directory and identify the object files. For the database backend, find the .db file in the token directory.
3

Dump the contents

Run the appropriate tool:
# File-based backend: pass one .object file at a time
softhsm2-dump-file /var/lib/softhsm/tokens/<token-uuid>/<object-uuid>.object

# SQLite3 database backend
softhsm2-dump-db /var/lib/softhsm/tokens/<token-uuid>/sqlite3.db

See also

  • softhsm2-util — token management and key import
  • softhsm2.conf(5) — SoftHSM configuration reference

Build docs developers (and LLMs) love