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 echo "unique_subject = no" > index.txt.attr
11 if [ ! -e serial ]; then
12 echo $(date +%s) > serial
15 if [ "$1" == "" ]; then
21 echo "IMPORTANT: If for any reason, you kill this process, type 'stty sane'"
22 echo "Enter the PassPhrase for your Key: "
27 if [ ! -e /private/ca.ekey ]; then
28 # Create a regaular rsa encrypted key
29 openssl genrsa -aes256 -out private/ca.ekey -passout stdin 4096 << EOF
34 if [ ! -e /private/ca.key ]; then
35 # Move to a Java/Filesystem readable key. Note that this one is NOT Encrypted.
36 openssl pkcs8 -in private/ca.ekey -topk8 -nocrypt -out private/ca.key -passin stdin << EOF
40 chmod 400 private/ca.key private/ca.ekey
43 if [ -e subject.aaf ]; then
44 SUBJECT="-subj /CN=$CN`cat subject.aaf`"
49 # Generate a CA Certificate
50 openssl req -config openssl.conf \
52 -new -x509 -days 7300 -sha256 -extensions v3_ca \
56 if [ -e certs/ca.crt ]; then
57 # All done, print result
58 openssl x509 -text -noout -in certs/ca.crt