josepy is a Python library that implements the JOSE (JSON Object Signing and Encryption) protocol, providing cryptographic primitives for creating and verifying JWS (JSON Web Signatures) and JWE (JSON Web Encryption) messages. It serves as a foundational cryptography component for projects like Certbot. The current version is 2.2.0, with releases typically aligned with Certbot updates or critical security fixes for its dependencies.
pip install josepyVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to generate an RSA key (or load an existing one), sign a JWS message with it, serialize the JWS, and then verify it using the corresponding public key. Remember to handle private keys securely in production environments.
Upgrade your Python interpreter to 3.9.2 or newer.
Carefully manage `cryptography` dependency versions in your project's `requirements.txt` or `pyproject.toml` to ensure stability. Refer to josepy's `setup.py` for its exact dependency requirements.
Always use strong, recommended cryptographic algorithms (e.g., RS256, PS256, ES256) and avoid insecure options. Keep up-to-date with current cryptographic best practices.
Implement robust key management practices: use environment variables, hardware security modules (HSMs), key management services (KMS), or encrypted storage for private keys. Never hardcode private keys.