🚀 DAY 5 OF LAUNCH WEEK:Introducing Webhook Events for Alert Changes.Learn more →
Socket
Book a DemoInstallSign in
Socket

jwks-slim

Package Overview
Dependencies
Maintainers
2
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jwks-slim

Library to retrieve RSA public keys from a JWKS endpoint

latest
Source
npmnpm
Version
1.0.0
Version published
Maintainers
2
Created
Source

JWKS-Client

A library to retrieve signing keys from a JWKS (JSON Web Key Set) endpoint.


Environments Supported

  • Nodejs
  • Web Workers
    • ex. Cloudflare Workers

Installation

npm install jwks-slim

Initialization

const { JwksClient } = require("jwks-client");
const client = new JwksClient({
  jwksUri: "your-jwks-endpoint",
  cache: true,  //default: true
  requestHeaders: {}  //optional
});

Usage

const kid = "RkI5MjI5OUY5ODc1N0Q4QzM0OUYzNkVGMTJDOUEzQkFCOTU3NjE2Rg";
const key = await client.getSigningKey(kid);
const signingKey = key.publicKey;
console.log(signingKey);

// Output 
/**
-----BEGIN PUBLIC KEY-----
MIIBojANBgkqhkiG9w0BAQEFAAOCAY8AMIIBigKCAYEAq3DnhgYgLVJknvDA3clA
TozPtjI7yauqD4/ZuqgZn4KzzzkQ4BzJar4jRygpzbghlFn0Luk1mdVKzPUgYj0V
kbRlHyYfcahbgOHixOOnXkKXrtZW7yWGjXPqy/ZJ/+kFBNPAzxy7fDuAzKfU3Rn5
0sBakg95pua14W1oE4rtd4/U+sg2maCq6HgGdCLLxRWwXA8IBtvHZ48i6kxiz9tu
-----END PUBLIC KEY-----
**/

Support

These are the supported key types(kty) :

key typesupport level
RSAall RSA keys
ECP-256, P-384, and P-521 curves

Keywords

jwks

FAQs

Package last updated on 29 Apr 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts