All Projects → cottonbeckfield → python-csr

cottonbeckfield / python-csr

Licence: other
Generate a CSR/Key via Python

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to python-csr

Check ssl cert
check_ssl_cert is a shell script (that can be used as a Nagios plugin) to check the CA and validity of an X.509 certificate
Stars: ✭ 248 (+535.9%)
Mutual labels:  certificate, openssl
ACMECert
PHP client library for Let's Encrypt (ACME v2 - RFC 8555)
Stars: ✭ 83 (+112.82%)
Mutual labels:  certificate, csr
cloud-signature-consortium
Cloud Signature Consortium Remote Signature Service Provider in Node.js
Stars: ✭ 19 (-51.28%)
Mutual labels:  certificate, openssl
Simple-TLS-Client-Server-with-Node.js
Simple TLS Client/Server with Node.js
Stars: ✭ 22 (-43.59%)
Mutual labels:  certificate, openssl
Easycert
EasyCert quickly generates web server TLS certificates that have been self-signed by a private certificate authority that it also creates.
Stars: ✭ 121 (+210.26%)
Mutual labels:  certificate, openssl
x509sak
X.509 Swiss Army Knife is a toolkit atop OpenSSL to ease generation of CAs and aid white-hat pentesting
Stars: ✭ 23 (-41.03%)
Mutual labels:  certificate, openssl
openssl-alpine
OpenSSL three tier certificate generator
Stars: ✭ 23 (-41.03%)
Mutual labels:  certificate, openssl
qsslcaudit
test SSL/TLS clients how secure they are
Stars: ✭ 22 (-43.59%)
Mutual labels:  certificate, openssl
Ssl Checker
Python script that collects SSL/TLS information from hosts
Stars: ✭ 94 (+141.03%)
Mutual labels:  certificate, openssl
Openssl Nodejs
is a package which gives you a possibility to run every OpenSSL command 🔒 in Node.js in a handy way. Moreover, parameters like -in, -keyin, -config and etc can be replaced by a raw data (Buffor).
Stars: ✭ 25 (-35.9%)
Mutual labels:  certificate, openssl
cryptocli
The ultimate tool for data transfer, manipulation and proxy.
Stars: ✭ 16 (-58.97%)
Mutual labels:  certificate, openssl
Mutual Tls Ssl
🔐 Tutorial of setting up Security for your API with one way authentication with TLS/SSL and mutual mutual authentication for a java based web server and a client with both Spring Boot. Different clients are provided such as Apache HttpClient, OkHttp, Spring RestTemplate, Spring WebFlux WebClient Jetty and Netty, the old and the new JDK HttpClient, the old and the new Jersey Client, Google HttpClient, Unirest, Retrofit, Feign, Methanol, vertx, Scala client Finagle, Featherbed, Dispatch Reboot, AsyncHttpClient, Sttp, Akka, Requests Scala, Http4s Blaze, Kotlin client Fuel, http4k, Kohttp and ktor. Also other server examples are available such as jersey with grizzly. Also gRPC examples are included
Stars: ✭ 163 (+317.95%)
Mutual labels:  certificate, openssl
pki-manager
IT Freelancers : Manage small PKI for multiple projects (or clients) with 2 bash scripts
Stars: ✭ 36 (-7.69%)
Mutual labels:  certificate, openssl
openssl ca
openssl_ca with QT GUI
Stars: ✭ 16 (-58.97%)
Mutual labels:  certificate, openssl
Forge
A native implementation of TLS in Javascript and tools to write crypto-based and network-heavy webapps
Stars: ✭ 4,204 (+10679.49%)
Mutual labels:  certificate, csr
Certstrap
Tools to bootstrap CAs, certificate requests, and signed certificates.
Stars: ✭ 1,689 (+4230.77%)
Mutual labels:  certificate, csr
Lhttps
Create https for local development environment or localhost.
Stars: ✭ 172 (+341.03%)
Mutual labels:  certificate, openssl
spki
A bash script wrapper for OpenSSL that generates and manages a simple PKI suitable for small deployments
Stars: ✭ 39 (+0%)
Mutual labels:  openssl
anvil
Tools for distributing ssl certificates
Stars: ✭ 29 (-25.64%)
Mutual labels:  certificate
aws-developer-associate-certificate
Note to pass the AWS Developer Associate Exam
Stars: ✭ 53 (+35.9%)
Mutual labels:  certificate

python-csr

Purpose

Generate a key, self-signed certificate, and certificate request.

Information

This script is for Python 2.7. Due to how the input() function has changed between python2 and python3, this script is not backwards compatible at this time.

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 have the setuptools python package and run:

python setup.py install

Usage

./csrgen -n [fqdn]

Note: you could always use '-h' in order to get some informations ;)

user@host> ./csrgen.py -h
usage: csrgen.py [-h] [-v] [-d] [-l LOG] [-n NAME] [-s [SAN [SAN ...]]]
                 [-k KEYSIZE] [-u UNATTENDED] [-f FILE] [-a] [-c]

optional arguments:
  -h, --help            show this help message and exit
  -v, --verbose         Output more infos
  -d, --debug           Enable debug mode
  -l LOG, --log LOG     Define log file (default: /var/log/certGen.log)
  -n NAME, --name NAME  Provide the FQDN
  -s [SAN [SAN ...]], --san [SAN [SAN ...]]
                        SANS, define alternative names
  -k KEYSIZE, --keysize KEYSIZE
                        Provide the key size
  -u UNATTENDED, --unattended UNATTENDED
                        Load CSR predefined options
  -f FILE, --file FILE  Load hosts file (CN and optional Alternate Names) list
  -a, --authority       Generate Authority certificate (Default is server)
  -c, --client          Generate client certificate (Default is server)

Basic usage would be

./csrgen -n test.test.com

When more than one hostname is provided, a SAN (Subject Alternate Name) certificate and request are generated. This can be acheived by adding a -s.

csrgen -s

./csrgen -n test.test.com -s mushu.test.com pushu.test.com

You can pass a yaml file as arguments to pre-fill your CSR values (C, ST, L, O, OU). Basically any attribute defined in the YAML file will be set in the certificate. On exception: if you force the hostname with -n parameter, it will override the 'Hostname' set in YAML file.

./csrgen -f sample.yaml -u csr.yaml

Debug options

A debug option (-d) and a verbose flag (-v) are available. If in any case you want to check the content of generated files, here is a quick cheat-sheet...

To read a CSR

openssl req -in test.test.com.csr -noout -text

To read a Certificate (CER)

openssl x509 -in test.test.com.cer -noout -text

To read a Certificate (PEM)

openssl x509 -inform pem -in test.test.com.cer -noout -text

TODO

  • Validate python3 compatibility
  • Finish SubClass Authority to generate a CA certificate (-x)
  • Create csrsign.py to sign a csr based on CA certificate and newly generated .csr
  • Implement Unit Tests
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].