Skip to content
This repository has been archived by the owner on Feb 25, 2019. It is now read-only.
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

Description

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions