Skip to content

polyjose

One JOSE implementation, every platform.

polyjose is a pure-Rust implementation of JWS, JWE, JWK and JWT. One core, with bindings for Node.js, WebAssembly, Kotlin and Swift, gives the same results, the same defaults and the same errors on every platform. Every binding passes the same conformance tests.

Install the package for your platform and import it into your project. Each guide then signs and verifies a first token.

The polyjose crate, for servers, command-line tools and any other Rust code. It is pure Rust and needs Rust 1.89 or later.

Add it to your project:

Terminal window
cargo add polyjose@0.2.0

Then import what you use:

use polyjose::Error;
use polyjose::header::Header;
use polyjose::jwa::SigningAlg;
use polyjose::jws::{self, ProtectedHeader, SignOptions, VerifyOptions};

Full guide for Rust →

polyjose is designed around RFC 8725: verify and decrypt take an explicit list of allowed algorithms, none is never accepted, and keys are bound to their algorithm family. These pages explain what that protects against and what it doesn’t.