0

I want to transfer and share some data inside JOSE JWE/JWS packets between different endpoints running differing os/libraries. Therefore I want to adhere to the relevant Standards (RFCs) as closely as possible, for interoperability. Sadly I did not find an answer while reading these texts (maybe missed something?).

Some of my payloads are naturally JSON while others are not. I think it would be dumb to convert the others into a JSON wrapper with just one entry, if only one entry is possible anyways.

I noticed anyway that some libraries only allow some form of dictionaries when encoding data into JWE/JWS, while others will accept any string. Therefore I am concerned if it would be considered bad practice to encode data plainly into these formats or not? I would like to design my protocols future proof, which is why I am very concerned for doing stuff the right way when working with encryption/encoding.

Masoud Keshavarz
  • 2,166
  • 9
  • 36
  • 48

1 Answers1

0

Only JWTs in JWE or JWS format needs to be a top level JSON object. But there is no requirement to payload/plaintext format/content in pure JWS and JWE.