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

  • RFC7797: JSON Web Signature (JWS) Unencoded Payload Option

  • RFC8037: OKP Key and EdDSA algorithm

  • RFC8812: ES256K algorithm

  • RFC9278: JWK Thumbprint URI

And draft RFCs implementation of:

  • draft-ietf-jose-deprecate-none-rsa15-02

  • draft-amringer-jose-chacha-02

  • draft-madden-jose-ecdh-1pu-04

Usage

A quick and simple JWT encoding and decoding would look something like this:

>>> from joserfc import jwt
>>> from joserfc.jwk import OctKey
>>> key = OctKey.import_key("secret")
>>> 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-1.2.0.tar.gz (188.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

joserfc-1.2.0-py3-none-any.whl (72.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: joserfc-1.2.0.tar.gz
  • Upload date:
  • Size: 188.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for joserfc-1.2.0.tar.gz
Algorithm Hash digest
SHA256 7708fec6bfcc76a58ea393fceb26e51e0de882975ec5ee1bc7d26cc15176bcdb
MD5 4c11d22f2aa90091d4a3899c3dc23072
BLAKE2b-256 f003a52bc0780d811d3a0fcba58832264bdf89c6b892151f9be43fe4ad906e5b

See more details on using hashes here.

Provenance

The following attestation bundles were made for joserfc-1.2.0.tar.gz:

Publisher: pypi.yml on authlib/joserfc

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

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

File metadata

  • Download URL: joserfc-1.2.0-py3-none-any.whl
  • Upload date:
  • Size: 72.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for joserfc-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0d7ecdb8dd106f385d7bfd61494ef226d61e3bb9cdb62cf62b51e73e97eeba3b
MD5 f8edea0f1e86b96162222e866127a177
BLAKE2b-256 eab7e622a38855be6c4e78ef4669ac4592ef3d2d9024fbb0038295a58b6b1efa

See more details on using hashes here.

Provenance

The following attestation bundles were made for joserfc-1.2.0-py3-none-any.whl:

Publisher: pypi.yml on authlib/joserfc

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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