No description
  • Nix 94.3%
  • Rust 4.9%
  • C++ 0.8%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-09-12 14:07:17 +02:00
src fix: make sure we find the same key again every time 2026-09-12 14:07:17 +02:00
tokens sign the argument with SHA256-RSA-PKCS 2026-09-11 17:40:59 +02:00
.gitignore initial 2026-09-11 14:22:46 +02:00
build.rs set opt level for build 2026-09-12 13:59:26 +02:00
Cargo.lock incremental builds using crate2nix 2026-09-11 15:36:43 +02:00
Cargo.nix incremental builds using crate2nix 2026-09-11 15:36:43 +02:00
Cargo.toml incremental builds using crate2nix 2026-09-11 15:36:43 +02:00
cbindgen.toml sign the argument with SHA256-RSA-PKCS 2026-09-11 17:40:59 +02:00
flake.lock initial 2026-09-11 14:22:46 +02:00
flake.nix clippy 2026-09-12 13:56:49 +02:00
plugin.cpp sign the argument with SHA256-RSA-PKCS 2026-09-11 17:40:59 +02:00
README.md show the result in the readme 2026-09-11 17:50:30 +02:00
softhsm2.conf sign the argument with SHA256-RSA-PKCS 2026-09-11 17:40:59 +02:00

Compile

$ nix develop

$ cargo build

Run

Generate a token once

$ softhsm2-util --init-token --slot 0 --label sometoken --pin 1234

Then drop into the Nix REPL

$ nix run .#nix
…
Type :? for help.
nix-repl> builtins.pkcs11 "some data that you want to be signed"
[nix_plugin_pkcs11] Received `some data that you want to be signed` as argument
[nix_plugin_pkcs11] Slot { slot_id: 857027596 }
"cb9c8c37604b06228bd97bfb77351c82d73f9514261884e92636b1ecddb87e566e9dc4a4150682e79a5f3e42a3e9bfc9521d0f82207a393d6895738d72353e9a8942618d642efa1f5aa2f0268c8a564ba2832c4d63702b714e49acf32fe99bb40afcad4c5a09201eb28c48252190da0833e4080bf7b9f350c6ed6837ca304b909ac12cabad5297cf93896043dbb445a7ccb40bb9a37c134b8d9b707356486a2d2a0972281b27858dc51506e111bc78e45ca20c89052ff2d8878db18d77dc8652e0aff50228b742363b2b6898773efbbb9edb1ca5e3db2b0233e8884435040b96ce01ec29c278c642579a879f98708c0ec06f63693dc4fd918624cc8a78dd7243"