Header cty to be add in JWE

Hi @dino and Team,

I am using a javacallout policy named java://apigee-callout-encrypted-jwt-20210630.jar and populating headers named kid,key encryption algorithm and content encryption algorithm.

Now our requirement is to get an extra header in jwe named cty with value JWT. I followed the document https://github.com/DinoChiesa/Apigee-CustomPolicy-EncryptedJWT.

But if i add header property as below

{“cty”: “JWT”}

But I am getting entity was not Json object error.

Please let me know the procedure to populate an additional header cty in headers section of jwe.

1 Like

I think you should use the latest version, 20240614 .

I don’t actually know if the json header was supported in the 20210630 version.

I’ve updated a policy in the example bundle to use cty in the JWE header. Check it out.

1 Like

Thanks for the update.

But while we are trying to deploy the code contains latest jar, we are getting any error related to java runtime something like 52.

1 Like

You need to rebuild the JAR.

https://github.com/DinoChiesa/Apigee-CustomPolicy-EncryptedJWT?tab=readme-ov-file#building-the-jar

1 Like