uselesskey-jsonwebtoken
jsonwebtoken adapter for
uselesskey test fixtures.
Implements JwtKeyExt so fixture types return jsonwebtoken::EncodingKey and
jsonwebtoken::DecodingKey directly — no manual PEM parsing needed in tests.
Features
| Feature | Description |
|---|---|
rsa |
RSA keypairs (RS256/RS384/RS512) |
ecdsa |
ECDSA keypairs (ES256/ES384) |
ed25519 |
Ed25519 keypairs (EdDSA) |
hmac |
HMAC secrets (HS256/HS384/HS512) |
all |
All key types |
Usage
[]
= { = "0.5.1", = ["rsa"] }
= { = "10", = ["use_pem", "rust_crypto"] }
use ;
use ;
use Factory;
use JwtKeyExt;
use ;
let fx = random;
let keypair = fx.rsa;
let claims = Claims ;
let token = encode.unwrap;
let decoded = .unwrap;
assert_eq!;
License
Licensed under either of Apache License, Version 2.0 or MIT license at your option.
See the uselesskey crate for full
documentation.