Package Exports
- jwks-provider
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (jwks-provider) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
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