jwks-provider
v0.1.0
Published
Serializer of keys for jwks route
Downloads
40
Readme
jwks-provider
Serializer of keys for jwks route
Use
npm install jwks-provider
// Example mounting a jwks route in express
const express = require('express')
const { getKeyList } = require('./someKeyProvider.js')
const { serialize } = require('jwks-provider')
const app = express()
app.get('/jwks', async (req, res) => {
/*
Returns an Array of
{
use: 'enc|sig',
kid: [some-key-id]|undefined,
publicKey: [pem formatted RSA key]
}
*/
const keys = await getKeyList()
res.send(serialize(keys))
})
Test
Requires Node version >= 10.12.0
since it uses crypto.generateKeyPair()
to
generate keys for the tests.
npm run lint && npm test