Skip to content

pdsaraujo/ownca

 
 

Repository files navigation

Build Status Documentation Status codecov pypi pypi Downloads pypi

Python Own Certificate Authority (OwnCA)

OwnCA makes it easy to handle a Certificate Authority (CA) and manage certificates for hosts, servers or clients.

An example of high-level usage:

>>> from ownca import CertificateAuthority
>>> ca = CertificateAuthority(ca_storage='/opt/CA', common_name='Corp CA')
>>> example_com = ca.issue_certificate('www.example.com', dns_names=['www.example.com', 'w3.example.com'])

Basically, in these three lines we:

  1. Imported the ownca Certificate Authority library

  2. Created a new CA named Corp CA that uses /opt/CA as CA storage for certificates, keys, etc.

  3. Created a signed certificate by Corp CA for www.example.com, whose files are also stored in /opt/CA/certs/www.example.com

     >>> example_com.cert
     <Certificate(subject=<Name(CN=www.example.com)>, ...)>

More detailed usage can be found in http://ownca.readthedocs.org.

Installation

pip install ownca

Documentation

Visit http://ownca.readthedocs.org

Development

Preparing the environment

git clone [email protected]:OwnCA/ownca.git
cd ownca
pipenv shell
pipenv install -d

In case you have macOS M1:

pip uninstall cryptography cffi
LDFLAGS=-L$(brew --prefix libffi)/lib CFLAGS=-I$(brew --prefix libffi)/include pip install cffi cryptography rust --no-binary :all:

Installing & enabling pre-commit

To automatically run checks before you commit your changes you should install the git hook scripts with pre-commit:

pre-commit install
pre-commit autoupdate

About

Own Certificate Authority - ownca

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 99.1%
  • Makefile 0.9%