Skip to content
This repository has been archived by the owner on Feb 25, 2019. It is now read-only.

Error: Algorithm requires a valid hash object. #82

Open
matt-richard opened this issue Nov 8, 2018 · 0 comments
Open

Error: Algorithm requires a valid hash object. #82

matt-richard opened this issue Nov 8, 2018 · 0 comments

Comments

@matt-richard
Copy link

I'm having trouble when trying to use the importKey method. The output I'm getting, along with the error is:

Error: Algorithm requires a valid hash object. at new RSA_OAEP (/project/node_modules/@trust/webcrypto/src/algorithms/RSA-OAEP.js:47:17) at RSA_OAEP.importKey (/project/node_modules/@trust/webcrypto/src/algorithms/RSA-OAEP.js:374:15) at Promise (/project/node_modules/@trust/webcrypto/src/SubtleCrypto.js:304:12) at new Promise (<anonymous>) at SubtleCrypto.importKey (/project/node_modules/@trust/webcrypto/src/SubtleCrypto.js:285:12) at /project/app.js:73:19 at Layer.handle [as handle_request] (/project/node_modules/express/lib/router/layer.js:95:5) at next (/project/node_modules/express/lib/router/route.js:137:13) at Route.dispatch (/project/node_modules/express/lib/router/route.js:112:3) at Layer.handle [as handle_request] (/project/node_modules/express/lib/router/layer.js:95:5)

The algorithm object I'm using is:
{"name": "RSA-OAEP","hash": {"name": "SHA-256"}}
and should be valid. Any assistance you could offer is greatly appreciated. I poked around a little bit logging stuff to the console, and found after 'modulusLength' and 'publicExponent' gets added to the object, 'hash' becomes undefined. I didn't dig anymore than that before I wanted to report the issue and get some insight first.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant