Skip to main content

Prune SSL certificate from a Let's Encrypt JSON file

Project description

Certificate Pruner

This script prunes a JSON file containing Let's Encrypt certificates. It removes one of the certificates and saves the pruned content to a new file.

Usage

usage: certificate_pruner.py [-h] -j JSON -r RESOLVER -o OUT

Do one thing well.

optional arguments:
  -h, --help            show this help message and exit
  -j JSON, --json JSON  the JSON file with the Let's Encrypt certificates
  -r RESOLVER, --resolver RESOLVER
                        the resolver for the certificates in the Let's Encrypt JSON file
  -o OUT, --out OUT     the output file where to save the pruned content

Prerequisites

Python 3

Installation

This script does not require installation. Simply download the script and run it using Python 3.

Example

$ python3 certificate_pruner.py -j certificates.json -r my_resolver -o pruned.json

The JSON files contains these certificates:

0 - example.com;
1 - example.org;

Which certificate do you want to remove? 1
Removing certificate for domain: example.org
Pruned content saved to: pruned.json.

Please do have a good day!

This command will load the certificates from certificates.json,
prompt the user to choose a certificate to remove,
remove it,
and save the result to pruned.json.

Dependencies

This script requires Python 3 and the following modules:

argparse
json
copy
enum

Exit codes

  • 0: success;
  • 1: bad argument;
  • 2: bad choice;
  • 3: file error;
  • 4: JSON error.

Contributions

Contributions are always welcome! If you would like to contribute to this project, please submit a pull request.

License

This script is licensed under the GPLv3 License.

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

certificate_pruner-0.1.2.tar.gz (3.3 kB view details)

Uploaded Source

Built Distribution

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

certificate_pruner-0.1.2-py3-none-any.whl (3.8 kB view details)

Uploaded Python 3

File details

Details for the file certificate_pruner-0.1.2.tar.gz.

File metadata

  • Download URL: certificate_pruner-0.1.2.tar.gz
  • Upload date:
  • Size: 3.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.13

File hashes

Hashes for certificate_pruner-0.1.2.tar.gz
Algorithm Hash digest
SHA256 cac7c2233c2e34b8937ab62f3cafebcfe0191ae8a8d0e94290ceb699c0f1131a
MD5 ce4104d7e1328183dad8b19f1ab3e90a
BLAKE2b-256 a6049617ae1731e07a489524d4cff4df8b0dc5dc54f88849033ef24e2d35518a

See more details on using hashes here.

File details

Details for the file certificate_pruner-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for certificate_pruner-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 3a2db4c0d3a1b7f34208a6d4a060a4435d5b6e09ad2a59d4f3acc3edcc10d3ba
MD5 369ac27bdbf6f33b0516dd92d3ce51d6
BLAKE2b-256 d48770a9df70c22d0ef0f6771e14e422c8e5295a83939e316b641936bd5f78c1

See more details on using hashes here.

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