Skip to main content

A simple command line tools to create and read CSR and P12

Project description

Python module to generate key, certificate request, self signed certificate and p12 certificate

Information

This can be used only with python2.7

Getting started

required modules:

  • Click

  • pycparser

  • PyYAML

Installing package using pip

$ pip install CertGenerator

Usage

Usage: cli.py [OPTIONS] COMMAND [ARGS]...

  A command line tool to create and read CSR and P12

Options:
  -v, --verbose  Display only if necessary
  -d, --debug    Display all details
  -V, --version  show version and exit
  -h, --help     Show this message and exit.

Commands:
  config               Edit or read config ini
  create               Create a single CSR
  create-multiple      Create multiple certificate using csv file
  create-multiple-p12  Create multiple p12 using csv file
  create-p12           Create a simple p12 Need key file and pem file
  init                 Create or edit certificate folder and csv file Add...
  read                 Read csr or p12

PRE-CONFIGURATION

Configuration files

serial.csv

serial.csv

serial

test1

test2

test3

config.ini

Create default folder
  • Default folder => $HOME/Documents/CertGenerator/

  • copy default csv file to $HOME/Documents/CertGenerator/csv/serial.csv

  • copy yaml file to $HOME/Documents/CertGenerator/csr.yaml

$ cert init

To change default folder or default csv:

$ cert init -cert [path/of/folder] -csv [path/of/csv/file]

or

$ cert config edit -cert [path/of/folder] -csv [path/of/csv/file]
To edit yaml file:
  • Enter the desired subject

  • Enter “-” to keep empty

  • If you want to create multiple csr using serial.csv, don’t use Commmon Name => just enter “-” to keep empty

  • Note: You always have old csr.yaml in folder under format csr.yam_[date od modification]

$ cert config edit-yaml

CONFIGURATION

Create csr

Create one csr

  • Use -c if you want to use csr.yaml to create csr

  • The key and csr files will be created in {folder}/certificate/csr/

  • Example: With the command below it will create
    • {folder}/certificate/csr/test/test.csr

    • {folder}/certificate/csr/test/test.key

$ cert create test -c

Create multiple csr

  • Use -c if you want to use csv file and csr.yaml

* cert create-multiple -c

Create p12

Create one p12

  • You need pem file and key file:

$ cert create-p12 test.p12 --pem [path/of/pem file] --key [path/of/key file] -pass [password(default:3z6F2Xfc)]

Create multiple p12

  • for creating multiple p12: pem file, key file and p12 must have the same name

  • Example if you create test1.p12 test2.P12 …:
    • In the csv file, you must have test1 test2 …

    • The pem files must be test1.pem test2.pem …

    • The key files must be test1.key test2.key …

    • It will search key files in folder/certificate/csr/

$ cert create-multiple-p12 -c --pem-folder [path/of/pem folder]

If you want to use an other folder to search key files, add –key-folder:

$ cert create-multiple-p12 -c --pem-folder [path/of/pem folder] --key-folder [path/of/key folder]

ChangeLog

see changes

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

CertGenerator-2.1.8.tar.gz (17.1 kB view details)

Uploaded Source

Built Distribution

CertGenerator-2.1.8-py2-none-any.whl (19.8 kB view details)

Uploaded Python 2

File details

Details for the file CertGenerator-2.1.8.tar.gz.

File metadata

  • Download URL: CertGenerator-2.1.8.tar.gz
  • Upload date:
  • Size: 17.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.20.1 setuptools/40.6.2 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/2.7.10

File hashes

Hashes for CertGenerator-2.1.8.tar.gz
Algorithm Hash digest
SHA256 ad36223e8e3bc27f4c2e7e5aea989451d71207fb7ff5719cfd85970fe29f1a79
MD5 4dd240c621f0c91ac96098c114587ca4
BLAKE2b-256 4ee8333b95e34213865d5336603324f6984d6d510e0e8beb76c34cf6b211ed3e

See more details on using hashes here.

File details

Details for the file CertGenerator-2.1.8-py2-none-any.whl.

File metadata

  • Download URL: CertGenerator-2.1.8-py2-none-any.whl
  • Upload date:
  • Size: 19.8 kB
  • Tags: Python 2
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.20.1 setuptools/40.6.2 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/2.7.10

File hashes

Hashes for CertGenerator-2.1.8-py2-none-any.whl
Algorithm Hash digest
SHA256 3940f08e2154ccad4d212cdf49823968a76d00add338cb7ac298582aab6a548b
MD5 11ae4a64a16bcdd494c6ab610f9d25b8
BLAKE2b-256 1bbdb52c886156b482c3787025af3b58f96659a9555052269378552b6b624e4c

See more details on using hashes here.

Supported by

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