Registry / auth-security / pyjwkest

pyjwkest

JSON →
library1.4.4pypiunverified

pyjwkest is a Python implementation of JSON Web Token (JWT), JSON Web Encryption (JWE), JSON Web Signature (JWS), and JSON Web Key (JWK) specifications. Currently at version 1.4.4, the library is in maintenance mode, meaning only security-critical bugs will be fixed, and no new features are planned. Releases are infrequent, focusing on stability and security.

pip install pyjwkest
INSTALL
IMPORT
SIG · PYJWKEST
P
pyjwkest
auth-securityenv1.4.4
Install
2.9s avg
Import
36ms
Disk
33MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v1.4.4 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.910 runs
installs and imports cleanly · install 0.0s · import 0.037s · 34.1MB
glibc
py 3.103.910 runs
installs and imports cleanly · install 2.9s · import 0.034s · 35MB
33MB installed
● package 33MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

JWT
from jwkest.jwt import JWT
JWS
from jwkest.jws import JWS
JWE
from jwkest.jwe import JWE
RSAKey
from jwkest.jwk import RSAKey
ECKey
from jwkest.jwk import ECKey
symKey
from jwkest.jwk import symKey
generate_key
from jwkest.jwk import generate_key

This quickstart demonstrates how to generate an RSA key pair, sign a set of claims into a JSON Web Token (JWT) using JWS, and then verify the signed JWT using the public key. It covers the basic flow for secure data exchange.

import json from jwkest.jwk import RSAKey, generate_key from jwkest.jws import JWS # 1. Generate an RSA key pair for signing and verification print("Generating RSA key pair...") rsa_key = generate_key(alg='RS256', size=2048) private_jwk = rsa_key.export_private() public_jwk = rsa_key.export_public() print("Private JWK (fragment):", {k: v for k, v in private_jwk.items() if k != 'd' and len(str(v)) < 50}) print("Public JWK (fragment):", {k: v for k, v in public_jwk.items() if len(str(v)) < 50}) # 2. Define JWT claims claims = { "iss": "example.com", "aud": "client.example.org", "sub": "user123", "exp": 1893456000 # January 1, 2030 } print("\nClaims to sign:", claims) # 3. Create a JWS object and sign the claims _jws_signer = JWS(json.dumps(claims)) signed_jwt = _jws_signer.sign(private_jwk) print("\nSigned JWT:", signed_jwt) # 4. Verify the JWT using the public key print("\nVerifying JWT...") _jws_verifier = JWS(signed_jwt) try: # Pass the public key for verification verified_payload_str = _jws_verifier.verify(jwk=public_jwk) verified_payload = json.loads(verified_payload_str) print("Verification successful!") print("Verified payload:", verified_payload) except Exception as e: print(f"Verification failed: {e}")
Debug
Known issues
breakingThe underlying cryptographic library changed from `pycrypto` to `pycryptodomex` in versions 1.1.0 and 1.2.0. Direct imports or assumptions about the crypto backend from `pycrypto` will break.
fix
Upgrade to pyjwkest >= 1.2.0 and ensure `pycryptodomex` is installed. Remove any direct `pycrypto` dependencies or usage.
affects: <=1.0.10
gotchaThe `pyjwkest` library is officially in maintenance mode. This means only security-critical bugs will be addressed, and no new features or significant development are planned. Users should be aware of this for long-term project planning.
fix
Consider this status when starting new projects or evaluating long-term support. Monitor for security updates, but don't expect feature enhancements.
affects: >=1.4.4
deprecatedOlder versions of pyjwkest (before 1.4.4) may use deprecated `array.tostring` and `array.tobytes` APIs, which can lead to warnings or errors in newer Python environments.
fix
Upgrade to pyjwkest 1.4.4 or newer to leverage fixes that address these deprecated APIs.
affects: <1.4.4
gotchaDeserialization of EC (Elliptic Curve) keys can be problematic in older versions, specifically if the keys use unsupported curves or malformed formats, leading to exceptions.
fix
Upgrade to pyjwkest 1.4.4 to benefit from improved error handling and support for EC key deserialization. Always ensure EC keys conform to standard formats.
affects: <1.4.4
breakingVersion 1.3.2 fixed a major problem in symmetric key construction. Code relying on symmetric keys from versions before 1.3.2 might generate incorrect or insecure keys.
fix
Upgrade to pyjwkest 1.3.2 or newer, especially if your application uses symmetric keys. Re-evaluate any existing symmetric keys generated with older versions.
affects: <1.3.2
Upgrade
Version history
1.4.4latest on PyPI · released Oct 4, 2025
Audit
Dependencies
pycryptodomexrequiredProvides underlying cryptographic primitives for JWT, JWS, JWE operations.
pyasn1requiredUsed for ASN.1 parsing, relevant for cryptographic operations, especially with certificates.
pyasn1_modulesrequiredProvides additional ASN.1 modules, extending pyasn1's capabilities for crypto.
Agent activity
15 hits · last 30 days
node
14
OpenAI (training)
1
Resources

No resource links recorded.

pyjwkest — pip install pyjwkest · libregistry