node-jose icon indicating copy to clipboard operation
node-jose copied to clipboard

Add defensive error messages to decrypt

Open ianwremmel opened this issue 9 years ago • 1 comments

When webcrypto fails to decrypt because the ciphertext is not decryptable, it rejects with a fairly obtuse DOMException/OperationError.

Debugging would be a lot easier if, before attempting to decrypt, there was a check to make sure that the value to decrypt is, in fact, a JWE.

ianwremmel avatar Apr 24 '16 20:04 ianwremmel

This is a worthwhile request. It'll need to cover JWE as well as JWS, and deal with the various serialization forms, but at least a cursory pass would help.

linuxwolf avatar Apr 26 '16 20:04 linuxwolf