Skip to main content

Module crypto

Module crypto 

Source
Expand description

Cryptographic helpers for OAuth2 tokens and secrets.

Enums§

CryptoError
Errors for cryptographic operations.

Functions§

generate_opaque_token
Generate a cryptographically secure random token with a configurable prefix.
generate_state_nonce
Generate a hex-encoded random state nonce for CSRF / PKCE state.
hmac_sha256_hex
HMAC-SHA256 keyed hash of a value.
hmac_sha256_verify
Verify an HMAC-SHA256 signature (constant-time comparison).
sha256_hex
SHA-256 hex digest of a raw value (unkeyed).