jwts-0.3.0 has been yanked.
jwt-rust
A rust implementation of JSON Web Tokens.
Examples
Sign
use ;
use Header;
use HS256;
let claims = Claims ;
assert_eq!;
Verify
use ;
use ;
use HS256;
let claims = Claims ;
let token = .unwrap;
let result = ;
assert!;
Validate Claims
use time;
use ;
use Claims;
use ;
let claims = Claims ;
assert_eq!;
assert_eq!;
assert_eq!;
assert_eq!;
assert_eq!;
assert_eq!;
assert_eq!;
Algorithms
Sign and verify use crate ring.
- HS256 - HMAC using SHA-256
- HS384 - HMAC using SHA-384
- HS512 - HMAC using SHA-512
- RS256 - RSASSA-PKCS1-v1_5 using SHA-256
- RS384 - RSASSA-PKCS1-v1_5 using SHA-384
- RS512 - RSASSA-PKCS1-v1_5 using SHA-512
- ES256 - ECDSA using P-256 and SHA-256
- ES384 - ECDSA using P-384 and SHA-384
- ES512 - ECDSA using P-521 and SHA-512
- PS256 - RSASSA-PSS using SHA-256 and MGF1 with SHA-256
- PS384 - RSASSA-PSS using SHA-384 and MGF1 with SHA-384
- PS512 - RSASSA-PSS using SHA-512 and MGF1 with SHA-512
More
RFC 7519 JSON Web Token (JWT)
RFC 7515 JSON Web Signature (JWS)
RFC 7518 JSON Web Algorithms (JWA)