Skip to main content

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'}

License

Licensed under BSD. Please see LICENSE for licensing details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

joserfc-0.6.0.tar.gz (156.7 kB view details)

Uploaded Source

Built Distribution

joserfc-0.6.0-py3-none-any.whl (59.3 kB view details)

Uploaded Python 3

File details

Details for the file joserfc-0.6.0.tar.gz.

File metadata

  • Download URL: joserfc-0.6.0.tar.gz
  • Upload date:
  • Size: 156.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.4

File hashes

Hashes for joserfc-0.6.0.tar.gz
Algorithm Hash digest
SHA256 980d7bfe2d0a1f8a3dfc3235e1daad621029d64deef6dd55f9381d2ba2adb6fc
MD5 fdd9fbe0b7a0315f27e5ec180b8bb857
BLAKE2b-256 e56221a052ebeeaf2de36ccdeac547eda8a62d2174e387e8fd732100f59c790f

See more details on using hashes here.

File details

Details for the file joserfc-0.6.0-py3-none-any.whl.

File metadata

  • Download URL: joserfc-0.6.0-py3-none-any.whl
  • Upload date:
  • Size: 59.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.4

File hashes

Hashes for joserfc-0.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8363bdef42a9b3bb23e6aabc30dee7ff785fb743f90d95af3659f665d0235055
MD5 c002244535dd653b1555e7e7c65d8ae6
BLAKE2b-256 fb91ee9f95480c0690914a29b1ad71f1efd072a0ebfe6bc2d65c42cbfb7ed2a1

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page