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: JSON Web Key (JWK) Thumbprint

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

  • RFC8037: OKP Key and EdDSA algorithm

  • RFC8812: ES256K algorithm

  • RFC9278: JWK Thumbprint URI

  • RFC9864: Ed25519 and Ed448 algorithms

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, jwk
>>> key = jwk.import_key("your-secret-key", "oct")
>>> encoded_jwt = jwt.encode({"alg": "HS256"}, {"k": "value"}, key)
>>> encoded_jwt
'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJrIjoidmFsdWUifQ._M8ViO_GK6TnZ9G9eqdlS7IpNWzhoGwaYYDQ3hEwwmA'
>>> token = jwt.decode(encoded_jwt, key)
>>> token.header
{'alg': 'HS256', 'typ': 'JWT'}
>>> token.claims
{'key': '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.6.3.tar.gz (229.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.6.3-py3-none-any.whl (70.5 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for joserfc-1.6.3.tar.gz
Algorithm Hash digest
SHA256 c00c2830db969b836cba197e830e738dd9dda0955f1794e55d3c636f17f5c9a6
MD5 8732f1579e210f1e83d519b217109d7c
BLAKE2b-256 ce90b8cc8635c4ce2e5e8104bf26ef147f6e599478f6329107283cdc53aae97f

See more details on using hashes here.

Provenance

The following attestation bundles were made for joserfc-1.6.3.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.6.3-py3-none-any.whl.

File metadata

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

File hashes

Hashes for joserfc-1.6.3-py3-none-any.whl
Algorithm Hash digest
SHA256 6beab3635358cbc565cb94fb4c53d0557e6d10a15b933e2134939351590bda9a
MD5 1b299d3f7faa9115a9047df4253d9901
BLAKE2b-256 124f124b3301067b752f44f292f0b9a74e837dd75ff863ee39500a082fc4c733

See more details on using hashes here.

Provenance

The following attestation bundles were made for joserfc-1.6.3-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