Skip to main content

A Python toolkit and CLI for generating self-signed certificates, CSRs, and private keys.

Project description

Project Logo
The Lupaxa Security Toolbox.
Part of The Lupaxa Project.

lupaxa-certtool

A clean, modern, fully-typed Python CLI and library for generating self-signed X.509 certificates, certificate signing requests (CSRs), and private keys.

Built for automation, reproducibility, and bulk-generation workflows used by The Lupaxa Project.

Features

  • Generate self-signed certificates, private keys, and CSRs
  • Generate from:
    • JSON config file
    • Directory of config files (bulk mode)
    • Pure command-line flags
  • Output:
    • To stdout
    • Or into an output directory, with one folder per certificate
  • Supports:
    • RSA key generation
    • SHA-256 / SHA-384 / SHA-512 digests
    • Validity period configuration
    • Optional private key encryption with passphrase
    • Subject Alternative Names (SANs) via JSON or CLI
  • Includes:
    • --generate-example to produce a full example JSON config
    • --inspect-cert to analyze existing PEM certificates
    • --validate-config to validate config files before use
  • Fully typed, linted, formatted, and tested
  • MkDocs documentation included

Installation

From PyPI

pip install lupaxa-certtool

From source (development mode)

pip install -e ".[dev]"

Usage

Basic self-signed certificate from CLI

certtool \
  --countryName UK \
  --stateOrProvinceName Somerset \
  --localityName Glastonbury \
  --organizationName "Lupaxa Project" \
  --commonName "example.local"

Using JSON Configuration

Generate an example config

certtool --generate-example --example-file example-cert.json

Use a JSON config file

certtool --config example-cert.json

Use a directory of configs (bulk mode)

certtool --config-dir configs/

Output Directory Structure

If you pass:

certtool --config-dir configs/ --output-dir output/

You get:

output/
├── example.local/
│   ├── cert.pem
│   ├── csr.pem
│   └── key.pem
└── api.internal/
    ├── cert.pem
    ├── csr.pem
    └── key.pem

Each certificate gets its own folder to prevent overwriting.

Private Key Encryption

JSON

{
  "passphrase": "your-secret-here"
}

CLI (overrides JSON)

certtool --config server.json --passphrase "some-secret"

Inspect a Certificate

certtool --inspect-cert output/example.local/cert.pem

Development

Run tests

make test

Type checking

make type

Lint, format, and style checks

make check-style

Run everything

make check-all

Build documentation

mkdocs serve

Documentation

The project includes MkDocs documentation.

Online documentation:

Documentation

Full documentation is available in the docs/ directory or served locally:

Serve docs locally

mkdocs serve

Then open the printed URL (usually http://127.0.0.1:8000/) in your browser.

Development

Clone the repository and install dev dependencies:

pip install -e ".[dev]"

Useful make targets:

make test        # run tests
make type        # type checking (mypy)
make check-style # lint + format + type
make check-all   # run tests, coverage, and audit

Repository Layout

lupaxa-certtool/
├── src/lupaxa/certtool/
│   ├── cli.py
│   ├── certs.py
│   ├── utils.py
│   ├── config.py
│   ├── example.py
│   ├── exceptions.py
│   ├── version.py
│   └── __init__.py
├── docs/
├── tests/
├── mkdocs.yml
├── Makefile
├── pyproject.toml
├── .editorconfig
├── .gitignore
└── README.md

© The Lupaxa Project.
Where exploration meets precision.
Where the untamed meets the engineered.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

lupaxa_certtool-0.1.0.tar.gz (21.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

lupaxa_certtool-0.1.0-py3-none-any.whl (21.4 kB view details)

Uploaded Python 3

File details

Details for the file lupaxa_certtool-0.1.0.tar.gz.

File metadata

  • Download URL: lupaxa_certtool-0.1.0.tar.gz
  • Upload date:
  • Size: 21.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for lupaxa_certtool-0.1.0.tar.gz
Algorithm Hash digest
SHA256 50a2e64105db71a5ffcc29e4e76fac3d66948d3c80b1fc87f9fa0bebbf6d2711
MD5 64cd3adc898cbed5b4653e9c7c8ae0e3
BLAKE2b-256 6125f718b5822d5a121d7cdd4ea53c6adffc31aa3ead55647701171d610f2651

See more details on using hashes here.

Provenance

The following attestation bundles were made for lupaxa_certtool-0.1.0.tar.gz:

Publisher: generate-release.yml on lupaxa-security-toolbox/certtool

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file lupaxa_certtool-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for lupaxa_certtool-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ef5d6a8d891d067231fcc756e87780bfc6375771d5aa25e4a6e545fac33ceea4
MD5 b04d9eba7f71d80210e0c40c00808cfb
BLAKE2b-256 d5f4ddcd28b3fa55d08d2e1feb3be5ea94dff427483faa8ab27eed5bb97ae3b5

See more details on using hashes here.

Provenance

The following attestation bundles were made for lupaxa_certtool-0.1.0-py3-none-any.whl:

Publisher: generate-release.yml on lupaxa-security-toolbox/certtool

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page