2 # this script generates a set of sample keys
4 rm -Rf *.csr *.crt *.key *.pkcs12 testca
6 openssl genrsa -out testca.key 4096
7 openssl req -new -key testca.key -out testca.csr -subj "/CN=local cacert-gigi testCA" -config selfsign.config
8 openssl x509 -req -days 365 -in testca.csr -signkey testca.key -out testca.crt
12 echo 01 > testca/serial
14 echo unique_subject = no >testca/db.attr
18 openssl genrsa -out $1.key 4096
19 openssl req -new -key $1.key -out $1.csr -subj "/CN=$1.cacert.local" -config selfsign.config
20 openssl ca -cert testca.crt -keyfile testca.key -in $1.csr -out $1.crt -days 356 -batch -config selfsign.config
22 openssl pkcs12 -inkey $1.key -in $1.crt -name $1 -export -passout pass: -out $1.pkcs12
24 keytool -importkeystore -noprompt -srckeystore $1.pkcs12 -destkeystore ../../config/keystore.pkcs12 -srcstoretype pkcs12 -deststoretype pkcs12 -srcstorepass "" -deststorepass ""
33 keytool -list -keystore ../../config/keystore.pkcs12 -storetype pkcs12 -storepass ""