Closed greg-signi closed 1 year ago
At first glance, we have a key with zero bytes of n-length instead of an empty key. I will see to fix this weekend.
Super! Btw observing the descriptor, noticed the json deserialization appears to fail for the key
Edit: Actually nevermind, the fields of the Key are there, I don't know why it's printing that 🤷
@greg-signi fixed in https://www.nuget.org/packages/JsonWebToken/1.9.4
Hello, thanks for the reply, I'll test this soon
@ycrumeyrolle indeed cek is empty now. Should the jwe generated appear as valid pasting it in jwt.io ?
Jwt.io supports only JWS (3 Base64 parts separated by '.'), not JWE (4 Base64 parts separated by '.')
The issue was that the second part, when it is a direct encryption algorithm, must be an empty part.
I see thanks. Can I decrypt now the JWE with your library using my private key in json, or for that I will need to try and find another way to test the decryption ? Huge thanks, our client will be happy w/ this fix.
In this example, _bobKey
is the private key for decryption.
_signingKey
is the signing key for the JWS as payload wrapped within the JWE.
If the Payload is just byte[] or string, the last one is not required.
Yep working as intended, thanks for the support. Massive thumbs up 👍 👍
Hello, should there be a encrypted key present when using this algorithm ?
According to my readings, this algorithm uses Direct Key Agreement, and when using this it seems that the JWE Encrypted key value should have been empty ? https://datatracker.ietf.org/doc/html/rfc7516#section-5.2 (10)
It's turning out to be a invalid JWE, since in the CEK part we are getting ".AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA." instead of the empty octet ?
Example:
Thanks in advance @ycrumeyrolle