Crate tana_auth

Crate tana_auth 

Source
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)