Expand description
§webgates-secrets
Secret and hashing primitives for webgates applications.
This crate provides the building blocks used to hash secrets, verify them, and bind stored hashed values to account identifiers.
§When to use this crate
Use webgates-secrets when you want:
- the
Secretvalue object for stored hashed credentials - the
hashingmodule for hashing and verification primitives - the
hashing::argon2::Argon2Hasherimplementation with secure presets - structured secret and hashing error types
The crate is intentionally focused on the secret and hashing boundary. Storage and repository concerns live in sibling crates.
§Quick start
use webgates_core::verification_result::VerificationResult;
use webgates_secrets::hashing::argon2::Argon2Hasher;
use webgates_secrets::hashing::hashing_service::HashingService;
let hasher = Argon2Hasher::new_recommended().unwrap();
let hashed = hasher.hash_value("user_password").unwrap();
let result = hasher.verify_value("user_password", &hashed).unwrap();
assert_eq!(result, VerificationResult::Ok);§Getting started on docs.rs
A good reading order is:
Modules§
Structs§
- Secret
- A hashed secret bound to a single account identifier.
Type Aliases§
- Result
- Convenience result alias for secrets and hashing operations.