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
>>> 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)

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.12.0.tar.gz (168.7 kB view details)

Uploaded Source

Built Distribution

joserfc-0.12.0-py3-none-any.whl (60.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: joserfc-0.12.0.tar.gz
  • Upload date:
  • Size: 168.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.4

File hashes

Hashes for joserfc-0.12.0.tar.gz
Algorithm Hash digest
SHA256 86625aef30bb9857f8c2f4320ea2ad4342a29319a66189cb743547c74a88b1ec
MD5 1741461679a382de0baccb693f8fe975
BLAKE2b-256 bdff2393f2e98c9542bab1eaf1de3c338fb74725ac533c1e2537895b9bc7701f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: joserfc-0.12.0-py3-none-any.whl
  • Upload date:
  • Size: 60.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.4

File hashes

Hashes for joserfc-0.12.0-py3-none-any.whl
Algorithm Hash digest
SHA256 210f21ec1c3d08c9a0d9969d7825d2020f365ad6b3a0d6c6c0b638704f96a5b0
MD5 4379e1040f299444c8ad317c3dd511d7
BLAKE2b-256 56d5a55bfeac4b01da5b98b3da0984003e4c7f3f0168ca1962c984c770f50b6a

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