2 # NOTE: This README is "bash" capable. bash README.txt
4 # create simple but reasonable directory structure
5 mkdir -p private certs newcerts
7 chmod 755 certs newcerts
9 if [ ! -e serial ]; then
13 if [ "$1" == "" ]; then
19 echo "IMPORTANT: If for any reason, you kill this process, type 'stty sane'"
20 echo "Enter the PassPhrase for your Key: "
25 if [ ! -e /private/ca.ekey ]; then
26 # Create a regaular rsa encrypted key
27 openssl genrsa -aes256 -out private/ca.ekey -passout stdin 4096 << EOF
32 if [ ! -e /private/ca.key ]; then
33 # Move to a Java/Filesystem readable key. Note that this one is NOT Encrypted.
34 openssl pkcs8 -in private/ca.ekey -topk8 -nocrypt -out private/ca.key -passin stdin << EOF
38 chmod 400 private/ca.key private/ca.ekey
41 if [ -e subject.aaf ]; then
42 SUBJECT="-subj /CN=$CN`cat subject.aaf`"
47 # Generate a CA Certificate
48 openssl req -config openssl.conf \
50 -new -x509 -days 7300 -sha256 -extensions v3_ca \
54 if [ -e certs/ca.crt ]; then
55 # All done, print result
56 openssl x509 -text -noout -in certs/ca.crt