2015-01-20 18:25:58 +00:00
|
|
|
# python-csr
|
2017-03-22 00:56:58 +00:00
|
|
|
## Purpose
|
2015-06-15 00:59:10 +00:00
|
|
|
Generate a key, self-signed certificate, and certificate request.
|
2015-06-15 00:59:24 +00:00
|
|
|
|
2017-03-22 00:56:58 +00:00
|
|
|
## Information
|
|
|
|
You'll notice there is a csrgen and csrgen35. This corresponds to their respective Python versions.
|
|
|
|
- csrgen uses Python 2.7
|
|
|
|
- csrgen34 uses Python 3.5
|
|
|
|
|
2017-08-09 23:15:27 +00:00
|
|
|
## Installation / Dependencies
|
|
|
|
The following modules are required:
|
|
|
|
- OpenSSL (pyopenssl)
|
|
|
|
- Argparse (argparse)
|
|
|
|
- YAML (pyyaml)
|
|
|
|
|
|
|
|
I've included a setup.py that will install these dependencies if you run:
|
|
|
|
```
|
2017-08-10 05:28:02 +00:00
|
|
|
python setup.py install
|
2017-08-09 23:15:27 +00:00
|
|
|
```
|
|
|
|
|
2017-03-22 00:56:58 +00:00
|
|
|
## Usage
|
|
|
|
csrgen [fqdn]
|
2015-06-15 01:00:14 +00:00
|
|
|
|
2015-07-13 17:10:04 +00:00
|
|
|
```
|
2017-08-10 05:28:02 +00:00
|
|
|
python csrgen -n test.test.com
|
2015-07-13 17:10:04 +00:00
|
|
|
```
|
2017-03-22 00:56:58 +00:00
|
|
|
|
2015-06-15 00:59:10 +00:00
|
|
|
When more than one hostname is provided, a SAN (Subject Alternate Name)
|
2017-03-22 00:56:58 +00:00
|
|
|
certificate and request are generated. This can be acheived by adding a -s.
|
2015-06-15 00:59:24 +00:00
|
|
|
|
2017-03-22 00:56:58 +00:00
|
|
|
csrgen <hostname> -s <san0> <san1>
|
2015-06-15 01:00:14 +00:00
|
|
|
|
2015-07-13 17:10:04 +00:00
|
|
|
```
|
2017-08-10 05:28:02 +00:00
|
|
|
python csrgen -n test.test.com -s mushu.test.com pushu.test.com
|
2015-07-13 17:10:04 +00:00
|
|
|
```
|
2017-08-10 05:28:02 +00:00
|
|
|
|
|
|
|
# TODO
|
|
|
|
- Consolidate Python 2.7 & 3.5
|
|
|
|
- For CLI (not -f), ensure a -n is provided or "fail" gracefully.
|
|
|
|
- Have the C, ST, L, O, OU stored in a .conf file and ask if
|
|
|
|
these are the settings the user wants to use before running.
|
|
|
|
- Turn this into a Class.
|