Skip to main content

The ultimate Python library for JOSE RFCs, including JWS, JWE, JWK, JWA, JWT

Project description

joserfc is a Python implementation of JSON Object Signing and Encryption (JOSE).

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

Uploaded Source

Built Distribution

joserfc-0.5.0-py3-none-any.whl (56.8 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for joserfc-0.5.0.tar.gz
Algorithm Hash digest
SHA256 8a52db2a02f6efc4386ff475f12984e847d00711cc7a608cd03653401c580263
MD5 c0f292f83c4e571cc97d5e4677baeca3
BLAKE2b-256 f150e66d3ca9506895e2facd320e2e11086ec1060cf65b0c6a02ae158c2b1d65

See more details on using hashes here.

File details

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

File metadata

  • Download URL: joserfc-0.5.0-py3-none-any.whl
  • Upload date:
  • Size: 56.8 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.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f2a417e5727b6f2d3d629ca0eb651a5baddc87c58f003bbba02a724094d84cee
MD5 ed4a7e5217a9781d21ddf0893f02cf26
BLAKE2b-256 c7783533d3dc2aca9d13790b1a85c6f7cb457438aad8cc88c3daa3ee54d5dab6

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