According to RFC 7516 it should be possible to encrypt the payload/claim, called JWE.
Are there any python libraries out there that support that?
I\'ve check
https://jwcrypto.readthedocs.io/en/latest/jwk.html#examples
from jwcrypto import jwk _k = jwk.JWK.generate(kty='RSA', size=2048) _text = _k.export() import json # loading the key back _import_key_dict = json.loads(_text) key = jwk.JWK(**json.loads(_import_key_dict))