compact serialization fails #50
Replies: 2 comments
-
Hi @marquina91, It would generally be immensely helpful if "something fails" report actually came with the error and its trace. It would save me plenty of time trying to trace your code. 'JWE Compact Serialization doesn\'t support multiple recipients, JWE unprotected headers or AAD' Is this what you're seeing? Well, no surprise - why are you passing If you're only gonna use the compact format use the
Compact cannot be used to encrypt the CEK for multiple recipients. Compact always only has one recipient.
|
Beta Was this translation helpful? Give feedback.
-
I'm sorry, forgot to put the error
Just the mistake you mentioned. I'll take a look at your suggestion, since it looks good. Thanks for the help and speed. |
Beta Was this translation helpful? Give feedback.
-
Hi,
I'm trying to migrate an application java to nodejs, and for this I decided to use this fantastic library.
but I can't use compact serialization when encrypting it with 2 keys, do you have any idea?
my current code in java would be:
// Initialize the result
String result = null;
and I tried to do it as follows:
const recipient = jose.JWK.generateSync('RSA', 2048, {use: 'enc', alg: 'RSA-OAEP-256'});
//message: text to encrypt
//publicKey of my application passed to buffer.
let enc = new jose.JWE.Encrypt(message, {}, {}, publicKey)
enc.recipient(recipient)
let result = enc.encrypt('compact'); // this fail
Regards and Thanks in advance.
Beta Was this translation helpful? Give feedback.
All reactions