blob: 0fd261f2f0d32ce8cc70f3e5bb28ecb04730a379 [file] [log] [blame]
Instrumental31d847e2018-03-26 14:17:19 -07001#
2# NOTE: This README is "bash" capable. bash README.txt
3#
4# create simple but reasonable directory structure
5mkdir -p private certs newcerts
6chmod 700 private
7chmod 755 certs newcerts
8touch index.txt
9echo '01' > serial
10
11echo "IMPORTANT: If for any reason, you kill this process, type 'stty sane'"
12echo "Enter the PassPhrase for your Key: "
13`stty -echo`
14#read PASSPHRASE
15PASSPHRASE=HunkyDoryDickoryDock
16`stty echo`
17
18# Create a regaular rsa encrypted key
19openssl genrsa -aes256 -out private/ca.ekey -passout stdin 4096 << EOF
20$PASSPHRASE
21EOF
22
23# Move to a Java readable time, not this one is NOT Encrypted.
24openssl pkcs8 -in private/ca.ekey -topk8 -nocrypt -out private/ca.key -passin stdin << EOF
25$PASSPHRASE
26EOF
27chmod 400 private/ca.key private/ca.ekey
28
29# Generate a CA Certificate
30openssl req -config openssl.conf \
31 -key private/ca.key \
32 -new -x509 -days 7300 -sha256 -extensions v3_ca \
33 -out certs/ca.crt << EOF
34$PASSPHRASE
35EOF
36
37# All done, print result
38openssl x509 -text -noout -in certs/ca.crt