Expand description
Authentication primitives: Ed25519 JWT signing, Argon2id password hashing.
Ed25519 keypair is generated once and stored in the config directory. JWTs use EdDSA (Ed25519) for signing — 128-bit security, tiny keys, fast.
Structs§
Enums§
Functions§
- generate_
keypair - Generate a new Ed25519 keypair and write PEM files to the config dir. Returns (private_pem, public_pem).
- hash_
password - Hash a password using Argon2id with a random salt.
- keypair_
dir - load_
keypair - Load the Ed25519 keypair from disk. Returns (private_pem, public_pem).
- load_
or_ generate_ keypair - Load or generate the keypair. Generates if missing.
- mint_
access_ token - Mint a new access token.
- now_
unix - parse_
duration_ secs - Parse a duration string like “15m”, “7d”, “24h”, “3600s” into seconds.
- validate_
access_ token - Validate an access token and return its claims.
- verify_
password - Verify a password against an Argon2id hash.