blob: f490b187b4a8deec20749a542433c206b3555f35 [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
15 for CA in `ls intermediateCAs`; do
16 cat "intermediateCAs/$CA" >> $MACH.chain
17 done
18
19 # Make a pkcs12 keystore, a jks keystore and a pem keystore
20 rm -f $MACH.p12
21 # Note: Openssl will pickup and load all Certs in the Chain file
22 openssl pkcs12 -name $FQI -export -in $MACH.chain -inkey private/$MACH.key -out $MACH.p12
23