aliri
This crate implements the Javascript/JSON Object Signing and Encryption (JOSE) standards, including:
- JSON Web Signature (JWS): RFC7515
- JSON Web Key (JWK): RFC7517
- JSON Web Algorithms (JWA): RFC7518
- JSON Web Token (JWT): RFC7519
JSON Web Encryption (JWE), RFC7516, is not yet supported.
Example
use Base64UrlRef;
use ;
use Regex;
use HasAlgorithm;
let token = from_str;
let secret = from_slice.to_owned;
let key = from
.with_algorithm
.with_key_id;
let mut keys = default;
keys.add_key;
let validator = default
.ignore_expiration
.add_approved_algorithm
.add_allowed_audience
.require_issuer
.check_subject;
let decomposed = token..unwrap;
let key_ref = keys.get_key_by_id.unwrap;
let data: Validated = token.verify
.expect;
# let _ = data;
Inspect this token at jwt.io and verify with the shared secret test.