blob: 53184e2fb79672e0e542247b2c67f98157e1fbe1 [file] [log] [blame]
Instrumental31d847e2018-03-26 14:17:19 -07001#
2# Create a p12 file from local certs
3#
4echo "FQI (Fully Qualified Identity): "
5read FQI
6
7if [ "$1" = "" ]; then
8 MACH=$FQI
9else
10 MACH=$1
11fi
12
13# Add Cert AND Intermediate CAs (Clients will have Root CAs (or not))
14 cat $MACH.crt > $MACH.chain
Instrumental924b18d2018-04-05 20:17:18 -050015 # Add THIS Intermediate CA into chain
16 cat "certs/ca.crt" >> $MACH.chain
Instrumental31d847e2018-03-26 14:17:19 -070017
18 # Make a pkcs12 keystore, a jks keystore and a pem keystore
19 rm -f $MACH.p12
20 # Note: Openssl will pickup and load all Certs in the Chain file
21 openssl pkcs12 -name $FQI -export -in $MACH.chain -inkey private/$MACH.key -out $MACH.p12
22