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.