pip install python-jose python from jose import jwk, jwt from jose.utils import base64url_encode, base64url_decode key = jwk.generate_symmetric_key(alg='HS256') plaintext = b"Hello, world!" ciphertext = jwt.encode({'data': plaintext}, key, algorithm='HS256') decoded = jwt.decode(ciphertext, key, algorithms=['HS256']) print(decoded['data'])


上一篇:
下一篇:
切换中文