-
| I am wanting to adapt the code located at https://github.com/panva/node-oidc-provider-example/blob/master/01-oidc-configured/generate-keys.js, which uses jose 2.0.3, to use jose 3.5.0, but I am getting stuck since keystore appears to not be part of the latest version of Jose? Replicated here: const fs = require('fs');
const path = require('path');
const jose = require('jose');
const keystore = new jose.JWKS.KeyStore();
Promise.all([
  keystore.generate('RSA', 2048, { use: 'sig' }),
  keystore.generate('RSA', 2048, { use: 'enc' }),
  keystore.generate('EC', 'P-256', { use: 'sig' }),
  keystore.generate('EC', 'P-256', { use: 'enc' }),
  keystore.generate('OKP', 'Ed25519', { use: 'sig' }),
]).then(() => {
  fs.writeFileSync(path.resolve('src/jwks.json'), JSON.stringify(keystore.toJWKS(true), null, 2));
});Digging around it seems that  Any help would be appreciated. | 
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
| KeyStore equivalent is not in v3.x, I have not yet made my mind about what form or shape it'll take. That being said you do not need a KeyStore to form a JWKSet object. | 
Beta Was this translation helpful? Give feedback.
-
| I wrote myself a small utility function to get a JWK from a JWKSet. I just copied the  To create a KeySet you can simply create an Object with an Array  {
  keys: [
    JWK1, JWK2, JWK3
  ]
}This is my utility function: https://gist.github.com/korki43/c28cab45a33a5795aca0a4b7d68eff56 | 
Beta Was this translation helpful? Give feedback.
-
| For anyone coming from Google: 
 | 
Beta Was this translation helpful? Give feedback.
KeyStore equivalent is not in v3.x, I have not yet made my mind about what form or shape it'll take.
That being said you do not need a KeyStore to form a JWKSet object.