-
I see there is a ticket that seems like it added browser support, but I haven't been able to get it to work for the scenario I'm looking to build. Using this function I can encrypt a message in Node, but it seems to crash in each browser.
w3c/webcrypto#82 (comment) |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 9 replies
-
You just need to generate a key for the correct algorithm. ES256 !== ECDH-ES+A256KW |
Beta Was this translation helpful? Give feedback.
-
There are clearly some kind of crypto things going on here that I just don't understand. Why do I need a separate signing key and encrypting key? I want the sender to have a key pair and the recipient to have a key pair. But if they need different kinds of keys for signing and encrypting, then each side has to manage 2 pairs of keys. Why in the world does it work fine in node and crash with a mysterious error in the browser? Everything seems like it matches in the JSFiddle, so I don't know what was mis-matched. What I know for sure is when I try to run my project with I also had this prototype using node's CLI where I already proved out all my message passing to make sure I could use |
Beta Was this translation helpful? Give feedback.
I don't get where your frustration comes from, you got very straight answers on what to change to get your ever changing code to work.
Your last just needed the second keypair generate alg to match the jwe alg it is used for, something you already had right after my very first answer so I assumed you learned.
https://jsfiddle.net/njqa18yL/1/