Skip to main content

Module crypto

Module crypto 

Source
Expand description

Cryptographic primitives used by RustAuth core.

Modules§

buffer
Constant-time byte comparison helpers.
jwt
Minimal HS256 JWT helpers.
password
Password hashing and verification.
random
Secure random string generation.

Structs§

Envelope
Parsed RustAuth encrypted payload envelope.
JweSecret
SecretConfig
Secret rotation configuration.
SecretEntry
Versioned secret entry.

Traits§

JweSecretSource
Secret material accepted by Better Auth-compatible JWE helpers.
SecretSource
Secret material accepted by symmetric encryption helpers.

Functions§

build_secret_config
Build a rotation config from validated entries.
format_envelope
Format a ciphertext with RustAuth’s secret-rotation envelope.
parse_envelope
Parse $oa$<version>$<ciphertext> payloads.
parse_secrets_env
Parse comma-separated version:secret entries.
symmetric_decrypt
Decrypt a string with either a raw secret or a versioned secret config.
symmetric_encrypt
Encrypt a string with either a raw secret or a versioned secret config.
validate_secrets
Validate versioned secrets and return warnings for weak current secrets.