[migrating]: https://github.com/kixel-ai/rind/blob/main/MIGRATING.md

# Run jsonwebtoken on rind

This page describes rind-jsonwebtoken as `main` has it, ahead of [rind-jsonwebtoken 11.0.3](https://crates.io/crates/rind-jsonwebtoken/11.0.3) on crates.io. Until its next release, take it from git at the commit this page describes. Beside the lines below, add this line under the `[patch.crates-io]` table of your workspace's root `Cargo.toml` (add the table if it has none), then run `cargo update -p rind-jsonwebtoken`:

```toml
rind-jsonwebtoken = { git = "https://github.com/kixel-ai/rind", rev = "80fc7ba544b53a6ca9ab21ba9a946c275eb19a06" }
```

That moves every crate in your tree that depends on rind-jsonwebtoken, and `cargo tree -i rind-jsonwebtoken` then shows it from `git+https://github.com/kixel-ai/rind`.

This crate provides an integration between [jsonwebtoken](https://github.com/Keats/jsonwebtoken) and [rind](https://github.com/kixel-ai/rind/), a fork of [Graviola](https://github.com/ctz/graviola/).

Leave jsonwebtoken's `aws_lc_rs` and `rust_crypto` features off, and add this crate:

```toml
[dependencies]
jsonwebtoken = "11"
rind-jsonwebtoken = "11"
```

Use it like:

```rust
rind_jsonwebtoken::DEFAULT_PROVIDER.install_default().unwrap();
```

And then use jsonwebtoken as normal.
`rind_jsonwebtoken::DEFAULT_PROVIDER` stands in for jsonwebtoken's `crypto::aws_lc::DEFAULT_PROVIDER`.
It signs and verifies HS256/384/512, ES256/384, RS256/384/512, PS256/384/512, and EdDSA, and implements the key utilities jsonwebtoken needs for JWKs.

## What rind cannot back

Nothing: it backs every algorithm jsonwebtoken names.

## WebAssembly

It builds for `wasm32-wasip2` and `wasm32-unknown-unknown`, the browser, where
rind needs its JavaScript random source, `getrandom = { version = "0.4",
features = ["wasm_js"] }`. [PLATFORMS.md](https://github.com/kixel-ai/rind/blob/main/PLATFORMS.md) lists what each adapter's
upstream needs there too, and why rind's constant-time checks do not cover wasm.

## Switch with an agent

Paste this into your coding agent, in your repository:

```text
Move this repository from ring or aws-lc-rs to rind, following
https://raw.githubusercontent.com/kixel-ai/rind/main/MIGRATE.md
```

It migrates on a local branch, reports the build time, binary size,
benchmarks, and tests before and after, and asks before opening a PR or
filing an issue. To migrate by hand, [MIGRATING.md][migrating] maps each
ring and aws-lc-rs item to rind's.

## Other libraries

- [ring](/from/ring)
- [aws-lc-rs](/from/aws-lc-rs)
- [rustls](/from/rustls)
- [rcgen](/from/rcgen)
- [dimpl](/from/dimpl)
- [str0m](/from/str0m)
- [object_store](/from/object_store)
- [openmls](/from/openmls)
- [Crates with their own crypto backend](/from)
