JWTSign
Rust jwt signing bindings for python
Usage:
import time
import json
from jwtsign import PyJwtEncoder, PyJwtDecoder
def read_bin(path: str) -> bytes:
with open(path, "rb") as file:
return file.read()
claims = {
"id": "example",
"exp": int(time.time() + 60),
}
private_key = read_bin("res/private_key.pem")
public_key = read_bin("res/public_key.pem")
encoder = PyJwtEncoder(private_key)
decoder = PyJwtDecoder(public_key, leeway=60)
# Using object encoding
token_claims_obj = encoder.encode_claims_json_obj(claims)
decoded_claims_obj = decoder.decode(token_claims_obj)
# Using serialized object encoding
token_claims_str = encoder.encode_claims_json_str(json.dumps(claims))
decoded_claims_str = decoder.decode(token_claims_str)
Decoder validates expiration time based on UTC with a leeway defined in the PyJwtDecoder::__init__.
[!NOTE] If at any point you have your claim as serialized JSON keep in mind that this performs slightly faster than the object as encoding parameter, as the rust code uses python bindings to call
json.dumpson the object.
Metadata
Release files for jwtsign 1.0.8
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| jwtsign-1.0.8.tar.gz | 3.7 kB | Without provenance | Details for jwtsign-1.0.8.tar.gz |
Built distributions (wheels)
| File | Actions Reset | |||
|---|---|---|---|---|
| jwtsign-1.0.8-cp311-cp311-manylinux_2_28_x86_64.whl | CPython 3.11 | CPython 3.11 | Linux glibc 2.28+ x86-64 | Details for jwtsign-1.0.8-cp311-cp311-manylinux_2_28_x86_64.whl |
| jwtsign-1.0.8-cp310-cp310-manylinux_2_28_x86_64.whl | CPython 3.10 | CPython 3.10 | Linux glibc 2.28+ x86-64 | Details for jwtsign-1.0.8-cp310-cp310-manylinux_2_28_x86_64.whl |
| jwtsign-1.0.8-cp39-cp39-manylinux_2_28_x86_64.whl | CPython 3.9 | CPython 3.9 | Linux glibc 2.28+ x86-64 | Details for jwtsign-1.0.8-cp39-cp39-manylinux_2_28_x86_64.whl |
| jwtsign-1.0.8-cp38-cp38-manylinux_2_28_x86_64.whl | CPython 3.8 | CPython 3.8 | Linux glibc 2.28+ x86-64 | Details for jwtsign-1.0.8-cp38-cp38-manylinux_2_28_x86_64.whl |
| jwtsign-1.0.8-cp37-cp37m-manylinux_2_28_x86_64.whl | CPython 3.7 | CPython 3.7 pymalloc | Linux glibc 2.28+ x86-64 | Details for jwtsign-1.0.8-cp37-cp37m-manylinux_2_28_x86_64.whl |
Total release size: 9.7 MB
Release files / jwtsign-1.0.8.tar.gz
| Download URL | jwtsign-1.0.8.tar.gz |
|---|---|
| Size | 3.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
418061349f6351d8c61f33f86fb01351adb49ba939aa03ccf633798584599cbc
|
|
BLAKE2b-256 checksum How to use checksums |
511fe7146016b0212e588d07a42cd09618bc5f052e31809d809aa081eb8ecf9d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.18
|
Release files / jwtsign-1.0.8-cp311-cp311-manylinux_2_28_x86_64.whl
| Download URL | jwtsign-1.0.8-cp311-cp311-manylinux_2_28_x86_64.whl |
|---|---|
| Size | 1.9 MB |
| Tags | CPython 3.11 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
81ca0792816bf496f761bdaad249c2a729a43f7559d06e9e770e3ffa76268356
|
|
BLAKE2b-256 checksum How to use checksums |
7799bbb2abb7aaa7c6a5f28b6f5509e3b08541b18373878d42958c35cb896b07
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.18
|
Release files / jwtsign-1.0.8-cp310-cp310-manylinux_2_28_x86_64.whl
| Download URL | jwtsign-1.0.8-cp310-cp310-manylinux_2_28_x86_64.whl |
|---|---|
| Size | 1.9 MB |
| Tags | CPython 3.10 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
991b312fe51c63a30c46e09c6a12d5038cf25ba79bba235f8047dd1f91b6ac6a
|
|
BLAKE2b-256 checksum How to use checksums |
b465191ace98beae0b6da08850c680afebd8fe9170f1611416b041de30be73e6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.18
|
Release files / jwtsign-1.0.8-cp39-cp39-manylinux_2_28_x86_64.whl
| Download URL | jwtsign-1.0.8-cp39-cp39-manylinux_2_28_x86_64.whl |
|---|---|
| Size | 1.9 MB |
| Tags | CPython 3.9 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
bd5a793f6f987f330c16949abbe522c811db02eba514f54a611e89ab603b6c6a
|
|
BLAKE2b-256 checksum How to use checksums |
b3e0850fc5363963fdf1cd907f38066a9a390fb72fd99b3af874b99e51539236
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.18
|
Release files / jwtsign-1.0.8-cp38-cp38-manylinux_2_28_x86_64.whl
| Download URL | jwtsign-1.0.8-cp38-cp38-manylinux_2_28_x86_64.whl |
|---|---|
| Size | 1.9 MB |
| Tags | CPython 3.8 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
c0ed9489d1c9822fec691dd30c94ef999c472508be6cadd728a7345b6f7e6457
|
|
BLAKE2b-256 checksum How to use checksums |
e94d23afb78497224390cf4e2ef10a84b4242287cedba3688263ff3a2722a9d8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.18
|
Release files / jwtsign-1.0.8-cp37-cp37m-manylinux_2_28_x86_64.whl
| Download URL | jwtsign-1.0.8-cp37-cp37m-manylinux_2_28_x86_64.whl |
|---|---|
| Size | 1.9 MB |
| Tags | CPython 3.7 CPython 3.7 pymalloc Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
5a75fd6745835627acda4dbecb7bbb479ef55ec293678605e1b219563107ad5f
|
|
BLAKE2b-256 checksum How to use checksums |
0b41f48a31380123f7687295a19d4e14507e12d670f56081efa8215dd56c2c56
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.18
|
Security for jwtsign 1.0.8
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.