Replies: 3 comments 4 replies
-
I tried your example and here is what I got (look at 2 dots in the middle) and the payload in your test is not actually encrypted and it shows up as blank.
Output:
|
Beta Was this translation helpful? Give feedback.
-
As far as you decryption code goes, you shouldn't need to encrypt it using an AES cipher. When you are using direct encryption mode, you are supposed to have the raw Content Encryption Key (CEK) that was used when creating the JWE message. |
Beta Was this translation helpful? Give feedback.
-
All good. |
Beta Was this translation helpful? Give feedback.
-
I have a legacy Java code that was written many years ago using JWE.Direct to encrypt:
The Java code looks like this:
I tried converting above Java code to golang and my initial attempt is as follows:
Is this the right approach? Not sure if I can pass the
block
tojwe.WithKey(...)
as I see this error:I looked at the example here:
jwx/jwe/jwe_test.go
Line 554 in beffa95
And tried passing the bytes as shown below:
And I did not see any error but the encrypted JWT has no encrypted payload:
What am I missing here?
Beta Was this translation helpful? Give feedback.
All reactions