Using Node-Jose to for RSA jwt with key store
✓ Published0🌍 Public
AAnsonT
Last edited Oct 11, 2017
Created on Oct 11, 2017
This example demonstrates how to sign and verify a JSON Web Token (JWT) using RSA keys managed through the `node-jose` keystore. It generates a fresh RSA 2048-bit key pair, stores it as a JSON keystore file, and then signs a payload with `JWS.createSign` using the `RS256` algorithm. The code also verifies the token with `JWS.createVerify`, converts the JWK to PEM via `jwk-to-pem`, and validates it again with the `jsonwebtoken` library’s `jwt.verify`. The keystore is loaded from or saved to `.cert/keystore.json`.
AI-generated description