Skip to main content

Crate craton_hsm

Crate craton_hsm 

Source
Expand description

Craton HSM — a PKCS#11 v3.0-compliant Software HSM in pure Rust.

This crate provides a complete software HSM implementation with classical and post-quantum cryptography, FIPS 140-3 readiness, and a C ABI compatible with any PKCS#11 consumer.

Modules§

audit
Tamper-evident audit logging with chained SHA-256.
config
Configuration — TOML-based HsmConfig with algorithm policy.
core
Core HSM state — the central HsmCore struct shared by all entry points. Core HSM state — the central struct shared by C ABI, daemon, and admin CLI.
crypto
Cryptographic operations — keygen, sign, encrypt, digest, PQC, DRBG, self-tests, backends.
error
Error types — HsmError enum with CK_RV mapping.
pkcs11_abi
PKCS#11 C ABI layer — types, constants, and 70+ #[no_mangle] function exports.
session
Session management — SessionManager, session state machine, handle allocation.
store
Object storage — in-memory ObjectStore, encrypted persistence, key material, backups.
token
Token and slot management — PIN hashing, login state, multi-slot support.