Implementations of JOSE RFCs in Python
See the codejoserfc is a Python library that provides a comprehensive implementation of several essential JSON Object Signing and Encryption (JOSE) standards.
A quick and simple JWT encoding and decoding would look something like this:
from joserfc import jwt, jwk
key = jwk.import_key("your-secret-key", "oct")
encoded = jwt.encode({"alg": "HS256"}, {"k": "value"}, key)
# 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJrIjoidmFsdWUifQ._M8ViO_GK6TnZ9G9eqdlS7IpNWzhoGwaYYDQ3hEwwmA'
token = jwt.decode(encoded, key)
print(token.header)
# {'alg': 'HS256', 'typ': 'JWT'}
print(token.claims)
# {'k': 'value'}
# validate claims (if needed)
claims_requests = jwt.JWTClaimsRegistry()
claims_requests.validate(token.claims)
It follows RFCs with extensible API. The module has implementations of:
OKP Key and EdDSA algorithmES256K algorithmEd25519 and Ed448 algorithmsAnd draft RFCs implementation of:
C20P and XC20P2023, Hsiaoming Yang. Under BSD-3 license.
74 followers · starred Mar 2026
8 followers · starred Nov 2025
Implementations of JOSE RFCs in Python
See the codejoserfc is a Python library that provides a comprehensive implementation of several essential JSON Object Signing and Encryption (JOSE) standards.
A quick and simple JWT encoding and decoding would look something like this:
from joserfc import jwt, jwk
key = jwk.import_key("your-secret-key", "oct")
encoded = jwt.encode({"alg": "HS256"}, {"k": "value"}, key)
# 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJrIjoidmFsdWUifQ._M8ViO_GK6TnZ9G9eqdlS7IpNWzhoGwaYYDQ3hEwwmA'
token = jwt.decode(encoded, key)
print(token.header)
# {'alg': 'HS256', 'typ': 'JWT'}
print(token.claims)
# {'k': 'value'}
# validate claims (if needed)
claims_requests = jwt.JWTClaimsRegistry()
claims_requests.validate(token.claims)
It follows RFCs with extensible API. The module has implementations of:
OKP Key and EdDSA algorithmES256K algorithmEd25519 and Ed448 algorithmsAnd draft RFCs implementation of:
C20P and XC20P2023, Hsiaoming Yang. Under BSD-3 license.
74 followers · starred Mar 2026
8 followers · starred Nov 2025