JWE JSON Serialization Representation Support

Issue #241 duplicate
Andriy Kharchuk created an issue

Hi,

I went through examples and source code and it seems to me that the library doesn't support JWE JSON Serialization Representation (with multiple recipients).

API that I found eventually calls decrypt(jweHeader, encryptedKey, iv, cipherText, authTag) and it expects both 'alg' and 'enc' in JWE token header value, while 'alg' is not present in 'protected' attribute value. The 'alg' cannot be added to the 'protected' value by API user because it (or JWE header in case of compact 5 parts serialized representation) is used as Additional Authenticated Data (AAD) during token encryption.

If I have not missed anything and JWE JSON Serialization representation is not supported indeed, are you planning to start supporting it?

Thank you

Here is a sample of JWE JSON representation:

{ "protected": "eyJlbmMiOiJBMTI4Q0JDLUhTMjU2In0", "unprotected": {"jku":"https://server.example.com/keys.jwks"}, "recipients":[ {"header": {"alg":"RSA1_5","kid":"2011-04-29"}, "encrypted_key": "UGhIOguC7IuEvf_NPVaXsGMoLOmwvc1GyqlIKOK1nN94nHPoltGRhWhw7Zx0- kFm1NJn8LE9XShH59_i8J0PH5ZZyNfGy2xGdULU7sHNF6Gp2vPLgNZ__deLKx GHZ7PcHALUzoOegEI-8E66jX2E4zyJKx-YxzZIItRzC5hlRirb6Y5Cl_p-ko3 YvkkysZIFNPccxRU7qve1WYPxqbb2Yw8kZqa2rMWI5ng8OtvzlV7elprCbuPh cCdZ6XDP0_F8rkXds2vE4X-ncOIM8hAYHHi29NX0mcKiRaD0-D-ljQTP-cFPg wCp6X-nZZd9OHBv-B3oWh2TbqmScqXMR4gp_A"}, {"header": {"alg":"A128KW","kid":"7"}, "encrypted_key": "6KB707dM9YTIgHtLvtgWQ8mKwboJW3of9locizkDTHzBC2IlrT1oOQ"}], "iv": "AxY8DCtDaGlsbGljb3RoZQ", "ciphertext": "KDlTtXchhZTGufMYmOYGS4HffxPSUrfmqCHXaI9wOGY", "tag": "Mz-VPPyU4RlcuYv1IwIvzw" }

Source: http://self-issued.info/docs/draft-ietf-jose-json-web-encryption.html#rfc.appendix.A.1.5

Comments (1)

  1. Log in to comment