bug: keystore.toJWKS throws on windows
See original GitHub issueI’m trying to generate a key, i used the code i found in the doc
const { JWKS: { KeyStore } } = require('@panva/jose');
const keystore = new KeyStore();
keystore.generateSync('RSA', 2048, {
alg: 'RS256',
use: 'sig',
});
console.log('this is the full private JWKS:\n', keystore.toJWKS(true));
But when i try to start it i get this error
E:\HAS\OpenId\node_modules\@trust\keyto\src\index.js:231
throw new InvalidOperationError('key is not a valid PEM string')
^
Error: key is not a valid PEM string
at Function.from (E:\HAS\OpenId\node_modules\@trust\keyto\src\index.js:231:15)
at module.exports.keyObjectToJWK (E:\HAS\OpenId\node_modules\@panva\jose\lib\help\key_utils.js:13:16)
at RSAKey.get [as e] (E:\HAS\OpenId\node_modules\@panva\jose\lib\jwk\key\base.js:84:23)
at RSAKey.[THUMBPRINT_MATERIAL] (E:\HAS\OpenId\node_modules\@panva\jose\lib\jwk\key\rsa.js:78:22)
at RSAKey.get [as kid] (E:\HAS\OpenId\node_modules\@panva\jose\lib\jwk\key\base.js:39:97)
at Function.entries (<anonymous>)
at RSAKey.toJWK (E:\HAS2\OpenId\node_modules\@panva\jose\lib\jwk\key\base.js:60:27)
at keys.map.key (E:\HAS2\OpenId\node_modules\@panva\jose\lib\jwks\keystore.js:95:60)
at Array.map (<anonymous>)
at KeyStore.toJWKS (E:\HAS\OpenId\node_modules\@panva\jose\lib\jwks\keystore.js:95:45)
If i understand correctly this is suppose to directly generate a key? I don’t see in the doc the need for another file so maybe i’m not understanding something and i know you are probably very busy atm but if there are things i can do to help let me know :x
Issue Analytics
- State:
- Created 5 years ago
- Comments:16 (8 by maintainers)
Top Results From Across the Web
jose/CHANGELOG.md - UNPKG
412, * keystore filtering by JWK Key thumbprint ... 622, * throw proper error when runtime doesn't support OKP ... toJWK() fixed on...
Read more >android - Keystore file doesn't exist - Stack Overflow
I had the same error in Windows 10 as well. But sorted it and finally got SHA-1 Key.
Read more >jose - Bountysource
Will provide screenshots of error. ... Is there a way to have the x5t and x5c produced along with the output of the...
Read more >node_modules/jose/CHANGELOG.md · master - PLMlab
Features. keystore filtering by JWK Key thumbprint (a9f6f71) ... throw proper error when runtime doesn't support OKP (0a16efb), closes #48 ...
Read more >@panva/jose: Versions | Openbase
Bug Fixes. keystore.toJWKS(true) does not throw on public keys (81abdfa), closes #42 ... KeyStore are now iterable (e.g. for ... of) (2eae293). Bug...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
ok with your workaround all test pass
Well thanks for being so reactive, i sent a PR to keyto as well