0
0
Fork 0
mirror of https://github.com/panva/jose.git synced 2025-03-14 22:07:35 -04:00
JWA, JWS, JWE, JWT, JWK, JWKS for Node.js, Browser, Cloudflare Workers, Deno, Bun, and other Web-interoperable runtimes
Find a file
2025-03-12 09:04:07 +01:00
.github chore: update bug report issue template 2025-02-23 14:17:20 +01:00
cookbook test: stop testing JWE RSA1_5 Algorithm 2024-02-14 19:08:52 +01:00
docs refactor: hide internal private fields and drop ProduceJWT inheritance 2025-03-11 13:24:38 +01:00
patches refactor: hide internal private fields and drop ProduceJWT inheritance 2025-03-11 13:24:38 +01:00
sponsor chore: updated sponsor logo 2024-10-07 08:55:51 +02:00
src chore(release): 6.0.10 2025-03-12 08:48:50 +01:00
tap test: refactor tap:deno imports 2025-03-12 09:04:07 +01:00
test test: cover more of encrypt/decrypt 2025-02-23 12:07:44 +01:00
tools build: add jsr.io distribution 2025-02-22 15:16:04 +01:00
tsconfig refactor: restructure src/lib and src/runtime now that runtime is fixed 2025-02-22 15:16:04 +01:00
.electron_flags.sh test: show warnings 2025-02-22 15:16:04 +01:00
.gitignore refactor: restructure src/lib and src/runtime now that runtime is fixed 2025-02-22 15:16:04 +01:00
.node_flags.sh test: show warnings 2025-02-22 15:16:04 +01:00
.prettierignore feat: Revised API, No dependencies, Browser Support, Promises 2020-11-14 18:26:46 +01:00
.prettierrc.json docs: update typedoc, format tsdoc 2022-06-29 09:54:41 +03:00
.versionrc.json build: include documentation updates in CHANGELOG 2025-02-22 18:06:41 +01:00
ava.config.mjs refactor: restructure src/lib and src/runtime now that runtime is fixed 2025-02-22 15:16:04 +01:00
CHANGELOG.md chore(release): 6.0.10 2025-03-12 08:48:50 +01:00
CODE_OF_CONDUCT.md chore: update coc 2021-07-20 12:50:11 +02:00
CONTRIBUTING.md docs: update coc link 2021-07-15 11:06:48 +02:00
jsr.json chore(release): 6.0.10 2025-03-12 08:48:50 +01:00
LICENSE.md chore: initial commit 2018-11-03 12:30:32 +01:00
package-lock.json chore(release): 6.0.10 2025-03-12 08:48:50 +01:00
package.json chore(release): 6.0.10 2025-03-12 08:48:50 +01:00
README.md docs: drop denoland/x links in README and add jsr 2025-03-10 08:57:17 +01:00
SECURITY.md chore: add SECURITY.md 2025-02-23 13:58:06 +01:00
tsconfig.json chore: bump packages 2025-03-01 13:34:08 +01:00
typedoc.json refactor: reorganize jwt claim set utils 2025-03-11 14:19:25 +01:00

jose

jose is JavaScript module for JSON Object Signing and Encryption, providing support for JSON Web Tokens (JWT), JSON Web Signature (JWS), JSON Web Encryption (JWE), JSON Web Key (JWK), JSON Web Key Set (JWKS), and more. The module is designed to work across various Web-interoperable runtimes including Node.js, browsers, Cloudflare Workers, Deno, Bun, and others.

Sponsor

Auth0 by Okta

If you want to quickly add JWT authentication to JavaScript apps, feel free to check out Auth0's JavaScript SDK and free plan. Create an Auth0 account; it's free!

💗 Help the project

Support from the community to continue maintaining and improving this module is welcome. If you find the module useful, please consider supporting the project by becoming a sponsor.

Dependencies: 0

jose has no dependencies and it exports tree-shakeable ESM1.

Documentation

jose is distributed via npmjs.com, jsr.io, jsdelivr.com, and github.com.

example ESM import1

import * as jose from 'jose'

JSON Web Tokens (JWT)

The jose module supports JSON Web Tokens (JWT) and provides functionality for signing and verifying tokens, as well as their JWT Claims Set validation.

Encrypted JSON Web Tokens

The jose module supports encrypted JSON Web Tokens and provides functionality for encrypting and decrypting tokens, as well as their JWT Claims Set validation.

Key Utilities

The jose module supports importing, exporting, and generating keys and secrets in various formats, including PEM formats like SPKI, X.509 certificate, and PKCS #8, as well as JSON Web Key (JWK).

JSON Web Signature (JWS)

The jose module supports signing and verification of JWS messages with arbitrary payloads in Compact, Flattened JSON, and General JSON serialization syntaxes.

JSON Web Encryption (JWE)

The jose module supports encryption and decryption of JWE messages with arbitrary plaintext in Compact, Flattened JSON, and General JSON serialization syntaxes.

Other

The following are additional features and utilities provided by the jose module:

Supported Runtimes

The jose module is compatible with JavaScript runtimes that support the utilized Web API globals and standard built-in objects or are Node.js.

The following runtimes are supported (this is not an exhaustive list):

Please note that certain algorithms may not be available depending on the runtime used. You can find a list of available algorithms for each runtime in the specific issue links provided above.

Supported Versions

Version Security Fixes 🔑 Other Bug Fixes 🐞 New Features Runtime and Module type
v6.x Universal2 ESM1
v5.x Universal2 CJS + ESM
v4.x Universal2 CJS + ESM
v2.x Node.js CJS

Specifications

Details
  • JSON Web Signature (JWS) - RFC7515
  • JSON Web Encryption (JWE) - RFC7516
  • JSON Web Key (JWK) - RFC7517
  • JSON Web Algorithms (JWA) - RFC7518
  • JSON Web Token (JWT) - RFC7519
  • JSON Web Key Thumbprint - RFC7638
  • JSON Web Key Thumbprint URI - RFC9278
  • JWS Unencoded Payload Option - RFC7797
  • CFRG Elliptic Curve ECDH and Signatures - RFC8037

The algorithm implementations in jose have been tested using test vectors from their respective specifications as well as RFC7520.


  1. CJS style let jose = require('jose') is possible in Node.js versions where process.features.require_module is true by default (^20.19.0 || ^22.12.0 || >= 23.0.0) or with the --experimental-require-module Node.js CLI flag. ↩︎

  2. Assumes runtime support of WebCryptoAPI and Fetch API ↩︎