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
>>> encoded = jwt.encode({"alg": "HS256"}, {"k": "value"}, "secret")
>>> encoded
'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJrIjoidmFsdWUifQ.ni-MJXnZHpFB_8L9P9yllj3RNDfzmD4yBKAyefSctMY'
>>> token = jwt.decode(encoded, "secret")
>>> token.header
{'alg': 'HS256', 'typ': 'JWT'}
>>> token.claims
{'k': 'value'}
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-0.9.0.tar.gz
.
File metadata
- Download URL: joserfc-0.9.0.tar.gz
- Upload date:
- Size: 166.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | eebca7f587b1761ce43a98ffd5327f2b600b9aa5bb0a77b947687f503ad43bc0 |
|
MD5 | 2847c7007c4b7b448a527913f3df72ed |
|
BLAKE2b-256 | 1ec0220477f18e91d518928d1f5844d23d663bd30df91258ea281f9564021b63 |
File details
Details for the file joserfc-0.9.0-py3-none-any.whl
.
File metadata
- Download URL: joserfc-0.9.0-py3-none-any.whl
- Upload date:
- Size: 60.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4026bdbe2c196cd40574e916fa1e28874d99649412edaab0e373dec3077153fb |
|
MD5 | d6da8e21d95e191a9fff4e9f879ab79a |
|
BLAKE2b-256 | fc0de573ebdecfedb05425c19c019dcd5855a1517792d132c629c1d41ad82dc1 |