Expand description
Tana Authentication Library
JWT creation and validation using Ed25519 signatures. Supports both native Rust and WebAssembly compilation.
§Key Features
- User-signed JWTs (not server-signed)
- Ed25519 signature verification
- Compatible with existing Tana key format (ed25519_ prefix)
- WASM support for TypeScript/Bun usage
§Usage
use tana_auth::{create_jwt, verify_jwt};
// Create JWT signed by user's private key
let jwt = create_jwt(
"ed25519_abc123...", // private key
"@alice", // username
90 // days until expiration
).unwrap();
// Verify JWT against user's public key
let claims = verify_jwt(&jwt, "ed25519_def456...").unwrap();Structs§
- JwtClaims
- JWT claims for Tana authentication
- JwtValidation
- JWT validation result
Functions§
- create_
jwt - Create a JWT signed with user’s Ed25519 private key
- create_
jwt_ impl - Internal implementation of JWT creation (also used for native Rust)
- verify_
jwt - Verify a JWT signature against user’s Ed25519 public key
- verify_
jwt_ impl - Internal implementation of JWT verification (also used for native Rust)