No "exports" main defined in E:\control-bench\node_modules\jose\package.json #137
Answered
by
panva
zhushenhang
asked this question in
Q&A
-
hi,dear friends,sorry for my English.
has the key generation been modified? |
Beta Was this translation helpful? Give feedback.
Answered by
panva
Dec 29, 2020
Replies: 2 comments 8 replies
-
You're jumping two semver major versions.
yes, that's why major version has been bumped. |
Beta Was this translation helpful? Give feedback.
8 replies
Answer selected by
zhushenhang
-
Adding example. It may save someones' time :) const { generateKeyPair, exportJWK, calculateJwkThumbprint } = require('jose') // [email protected]
async function generateJWKS () {
const { publicKey, privateKey } = await generateKeyPair('RS256')
const privateJwk = await exportJWK(privateKey)
console.log('JWKS json with public and private key : ', privateJwk)
const publicJwk = await exportJWK(publicKey)
console.log('JWKS json with only public key : ', publicJwk)
const kid = await calculateJwkThumbprint(publicJwk)
console.log('kid : ', kid)
}
generateJWKS() |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You're jumping two semver major versions.
yes, that's why major version has been bumped.