Certy is a simple X509 certificate generator for unit and integration tests.
Project description
python-certy
Description
Certy provides a simple API for creating X509 certificates and certificate revocation lists on demand when running unit tests. No more storing test certificates and private keys in the repository!
Python-certy is a version of similar tool for command line and Golang called certyaml and java-certy for Java.
Example
from certy import Credential
ca = Credential().subject("CN=ca")
ca.write_certificates_as_pem("ca.pem")
cred = Credential().subject("CN=server").issuer(ca)
cred.write_certificates_as_pem("cert.pem")
cred.write_private_key_as_pem("key.pem")
Documentation
The latest documentation is available here. See also tests for more examples.
Installation
Install certy from PyPI:
pip install certy
Development
Create virtual environment by running python3 -m venv .venv
, then activate it source .venv/bin/activate
.
Install dependencies by running pip install -r dev-requirements.txt
.
Run tests with pytest
.
To build wheel, run flit build
and check the generated wheel in dist
directory.
To find out coverage of tests, execute coverage run -m pytest
and then coverage html
.
The coverage report is generated to htmlcov/index.html
.
Run make html
on docs
directory to generate documentation.
Open docs/_build/html/index.html
to view the generated documentation.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file certy-0.2.1.tar.gz
.
File metadata
- Download URL: certy-0.2.1.tar.gz
- Upload date:
- Size: 18.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.32.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e372b3fd78208b4168e46823e9a6749fcbc33da195148c3a8f4d2620dcfcf2ba |
|
MD5 | 2c1c2d3044c8c83f7b5cd6ef9217a755 |
|
BLAKE2b-256 | 4f56edd1733df2625a38536290c72d59ccaa31c3fb6e2fb8fc3f27a4fdd858c6 |
File details
Details for the file certy-0.2.1-py3-none-any.whl
.
File metadata
- Download URL: certy-0.2.1-py3-none-any.whl
- Upload date:
- Size: 13.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.32.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5e63a175bc1c5070875c46657ee075fb0b79b1c8cfe99a2704196d81159fc8f5 |
|
MD5 | 53fa791add442ece5568418cdb56aff4 |
|
BLAKE2b-256 | 696f4df7bb25ac38fcd2b45f2f338139b99d469f41f7508ea861941178068e7f |