Closed chaudharydeepanshu closed 3 weeks ago
Please provide a gist with all the code your running.
A script that shows how to compile it.
And how to open it in a browser AND what browser!
Do not that WebCrypto
only works in https://
, so if you're opening it as a file or opening it on localhost it shouldn't work.
I've occasionally done such setups locally with ngrok
, come to think of it I'm actually surprised our integration tests work in all browsers -- I think those just load from localhost, but maybe package:test
does some magic :rofl:
Please provide a gist with all the code your running.
A script that shows how to compile it.
And how to open it in a browser AND what browser!
I'll soon add a small example app to recreate the issue.
Do not that WebCrypto only works in https://
Btw, this secure content requirement is weird because I was running the app on localhost without using a web worker and it worked fine. Does the secure content requirement only apply when I run it inside web workers?
Thanks for the response!
Does the secure content requirement only apply when I run it inside web workers?
Don't know this might differ from browser to browser, and can probably be disabled when starting the browser.
If you're interested in documenting when this works, we're happy to take a PR another bullet point to the compatibility notes in the README.
Otherwise, I think we consider this outside the scope of this package. We offer what the browser offers.
Description
I'm using this package for RSA decryption in both isolates and web workers. While it works fine in isolates, I encounter a null check error when running in a web worker.
Code
This is the function that runs for decryption:
Error
This is the error I get in the web worker:
From what I can tell, the error is being thrown on this line:
Environment
Steps to Reproduce
decryptDEKWeb
function inside a web worker environment.RsaOaepPrivateKey.importPkcs8Key
.Expected Behavior
The function should successfully import the private key and decrypt the data, as it does in an isolate.
Additional Information
keyData
passed toimportPkcs8Key
is valid, as confirmed by logging it before the function call.Let me know if any further details are required for debugging.