Public operational surface for configured slots.
Each slot in config :pkcs11ex, :slots maps to a Pkcs11ex.Slot.Server
GenServer started under Pkcs11ex.SlotSupervisor. This module exposes the
caller-facing API.
Phase 2 step 1 surface
Sign / verify here are the slot-aware path with persistent sessions —
one PKCS#11 session per slot, reused across calls. Compare with
Pkcs11ex.sign_bytes/2 / verify_bytes/4 which take an explicit module +
slot_id and open a new session per call (the Phase 1 path).
Step 3 unifies these by routing Pkcs11ex.sign_bytes/2 through this module
whenever a :signer opt is provided.
Summary
Functions
List all running slot servers along with their state.
Explicit one-shot login. Use this when bypassing a configured pin_callback
(e.g., in scripts or tests). The PIN is consumed once; the next sign call
reuses the logged-in session.
Explicit logout. Closes the PKCS#11 user session but keeps the underlying session resource open for reuse (next sign call will need a PIN again).
Sign data with key_label on slot_ref. The PIN is taken from opts[:pin]
if the slot isn't already logged in. Subsequent calls reuse the logged-in
session.
Returns the slot's current state (:uninitialized, :open, or :logged_in).
Verify a signature on slot_ref.
Types
@type state() :: :uninitialized | :open | :logged_in
State exposed by status/1.
Functions
List all running slot servers along with their state.
Explicit one-shot login. Use this when bypassing a configured pin_callback
(e.g., in scripts or tests). The PIN is consumed once; the next sign call
reuses the logged-in session.
Explicit logout. Closes the PKCS#11 user session but keeps the underlying session resource open for reuse (next sign call will need a PIN again).
Sign data with key_label on slot_ref. The PIN is taken from opts[:pin]
if the slot isn't already logged in. Subsequent calls reuse the logged-in
session.
Mechanism is the algorithm's PKCS#11 mechanism atom (e.g.,
:ck_sha256_rsa_pkcs_pss for PS256 — see SignCore.Algorithm.PS256.signing_mechanism/0).
Returns the slot's current state (:uninitialized, :open, or :logged_in).
Verify a signature on slot_ref.