Skip to content

Instantly share code, notes, and snippets.

@dleonard00
Last active February 10, 2017 23:26
Show Gist options
  • Save dleonard00/6c5e0575847a1fc1743a6802cd991cfe to your computer and use it in GitHub Desktop.
Save dleonard00/6c5e0575847a1fc1743a6802cd991cfe to your computer and use it in GitHub Desktop.
#! /bin/bash
#generate private ca key
openssl genrsa -aes128 -out ca.key 2048
#remove password form ca.key
openssl rsa -in ca.key -out ca_decrypted.key
#generage self signed ca cert
openssl req -new -x509 -days 365 -key ca_decrypted.key -out ca.crt
#convert ca crt to pem format
openssl x509 -in ca.crt -out ca.pem -outform PEM
#convert pem to crt
openssl x509 -outform pem -in ca.pem -out ca.crt
#same as above but with der format.
openssl x509 -outform der -in ca.pem -out ca.crt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment