1>>> import jwt
2>>> private_key = b"-----BEGIN PRIVATE KEY-----\nMIGEAgEAMBAGByqGSM49AgEGBS..."
3>>> public_key = b"-----BEGIN PUBLIC KEY-----\nMHYwEAYHKoZIzj0CAQYFK4EEAC..."
4>>> encoded = jwt.encode({"some": "payload"}, private_key, algorithm="RS256")
5>>> print(encoded)
6eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzb21lIjoicGF5bG9hZCJ9.4twFt5NiznN84AWoo1d7KO1T_yoc0Z6XOpOVswacPZg
7>>> decoded = jwt.decode(encoded, public_key, algorithms=["RS256"])
8{'some': 'payload'}
9