pub struct SignedIdentity { /* private fields */ }Expand description
A credential signed with a secret this process holds.
The credential is <payload>.<mac>, where payload is
actor;expiry_millis;key=value;key=value… and mac is a keyed BLAKE3 of it under the shared
secret, hex-encoded. Verification is a constant-time comparison of the recomputed tag.
This is a symmetric scheme, and its limits are the point of writing them here. It suits a
gateway that mints credentials for a Beck process behind it — the shape a rung-1 deployment
actually has — and it does not suit a public identity provider, because everything that can
verify a credential can also mint one. An asymmetric verifier is D6’s OIDC work and needs a
signature library (48 §48.13).
BLAKE3’s keyed mode is a MAC by construction and is already in this workspace’s dependency graph, so this costs no new dependency and no hand-rolled cryptography — the two ways a module like this usually goes wrong.
Implementations§
Source§impl SignedIdentity
impl SignedIdentity
Sourcepub fn new(secret: &str, clock: Arc<dyn Clock>) -> SignedIdentity
pub fn new(secret: &str, clock: Arc<dyn Clock>) -> SignedIdentity
A verifier for a shared secret of any length, stretched to BLAKE3’s key size by its own derivation function rather than by truncation or padding.