JWK generate does not recognize options object
See original GitHub issueDescribe the bug
when running
JWK.generateSync("RSA", 2048, {use: 'enc'})
it produces error
TypeError: parameters argument must be a plain object when provided
at asKey (/home/runner/JOSE/node_modules/jose/lib/jwk/import.js:39:11)
at Object.generateSync (/home/runner/JOSE/node_modules/jose/lib/jwk/generate.js:40:14)
at /home/runner/JOSE/index.js:11:5
at Script.runInContext (vm.js:131:20)
at Object.<anonymous> (/run_dir/interp.js:156:20)
at Module._compile (internal/modules/cjs/loader.js:1133:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1153:10)
at Module.load (internal/modules/cjs/loader.js:977:32)
at Function.Module._load (internal/modules/cjs/loader.js:877:14)
To Reproduce
Steps to reproduce the behaviour:
- Use JWK.generate/generateSync with options
Expected behaviour A clear and concise description of what you expected to happen.
should not produce error
Environment:
jose
version: [e.g. v1.0.0]
1.27.1
- node version: [e.g. v12.0.0]
v12.16
Additional context Add any other context about the problem here.
- the bug is happening on latest
jose
too. - i have searched the issues tracker on github for similar issues and couldn’t find anything related.
i do not seem to be getting this issue on v12.18.0
the code which produced the error was run on repl.it
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Unable to parse JWK in Java - jwt - Stack Overflow
When I try jwk.toString() , I do see the kty key in the main json body. Why doesn't serialization/deserialization of the native JWK...
Read more >JSON Web Key (JWK) — JWCrypto 1.4.2 documentation
A JSON Web Key is represented by a JWK object, related utility classes and ... will be generated according to the defaults or...
Read more >jwk - Go Packages
First and foremost, this is a "per-object" option. Meaning that given the same serialized format, it is possible to generate two objects whose ......
Read more >JSON Web Key Sets - Auth0
The JSON Web Key Set (JWKS) is a set of keys containing the public keys used to verify any JSON Web Token (JWT)...
Read more >Generate JWT - IBM
Property label Property name Required Data type
Title title No string
Description description No string
JSON Web Token (JWT) jwt No string
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
This was fixed a few weeks ago. Just thought I’d let you know
hmm okay, i will ask around and see if anyone at repl.it is able to resolve this. thanks for the help!