The ultimate Python library for JOSE RFCs, including JWS, JWE, JWK, JWA, JWT
Project description
·joserfc· is a Python library that provides a comprehensive implementation of several essential JSON Object Signing and Encryption (JOSE) standards.
This package contains implementation of:
RFC7515: JSON Web Signature
RFC7516: JSON Web Encryption
RFC7517: JSON Web Key
RFC7518: JSON Web Algorithms
RFC7519: JSON Web Token
RFC7520: Examples of Protecting Content Using JSON Object Signing and Encryption
RFC7638: thumbprint for JWK
RFC8037: OKP Key and EdDSA algorithm
RFC8812: ES256K algorithm
And draft RFCs implementation of:
C20P and XC20P
ECDH-1PU algorithms
Usage
A quick and simple JWT encoding and decoding would look something like this:
>>> from joserfc import jwt
>>> from joserfc.jwk import OctKey
>>> encoded = jwt.encode({"alg": "HS256"}, {"k": "value"}, key)
>>> encoded
'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJrIjoidmFsdWUifQ.ni-MJXnZHpFB_8L9P9yllj3RNDfzmD4yBKAyefSctMY'
>>> token = jwt.decode(encoded, key)
>>> token.header
{'alg': 'HS256', 'typ': 'JWT'}
>>> token.claims
{'k': 'value'}
>>> claims_requests = jwt.JWTClaimsRegistry()
>>> claims_requests.validate(token.claims)
Useful Links
License
Licensed under BSD. Please see LICENSE for licensing details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file joserfc-1.0.0.tar.gz
.
File metadata
- Download URL: joserfc-1.0.0.tar.gz
- Upload date:
- Size: 169.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.12.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 298a9820c76576f8ca63375d1851cc092f3f225508305c7a36c4632cec38f7bc |
|
MD5 | d0b7e7b6de7f08f22c324117649de8b7 |
|
BLAKE2b-256 | dc56be93d6e313d0e8c4be6f459dafeb543d8a5a663afa10cb4521363052f824 |
File details
Details for the file joserfc-1.0.0-py3-none-any.whl
.
File metadata
- Download URL: joserfc-1.0.0-py3-none-any.whl
- Upload date:
- Size: 60.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.12.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1de2c3ac203db8fceb2e84c1e78ba357030b195c21af046a1411711927654a09 |
|
MD5 | b1fbd257bf74999d3cb8e76343b2eabd |
|
BLAKE2b-256 | 4cc44d2b7d8482652e610242261bf25059b33832a345d36e9335473bcdf5a0d2 |