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
>>> 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.0.1.tar.gz (169.5 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.0.1-py3-none-any.whl (60.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: joserfc-1.0.1.tar.gz
  • Upload date:
  • Size: 169.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for joserfc-1.0.1.tar.gz
Algorithm Hash digest
SHA256 c4507be82d681245f461710ffca1fa809fd288f49bc3ce4dba0b1c591700a686
MD5 26f6a06dadf6859ee720da5b21cb9b1c
BLAKE2b-256 341b4feb48eac1f2b39239b097c53b39839d413f03da5391a3fd6d6daaca5352

See more details on using hashes here.

File details

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

File metadata

  • Download URL: joserfc-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 60.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for joserfc-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ae16f56b4091181cab5148a75610bb40d2452db17d09169598605250fa40f5dd
MD5 e44f6966f362b1ebc2fd2f003dc5c1ef
BLAKE2b-256 2823bdc4669992ed61ec5c6ab21a60b781ec2ff9e3347b3a82c586876dce3947

See more details on using hashes here.

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