Instrumental | 31d847e | 2018-03-26 14:17:19 -0700 | [diff] [blame] | 1 | # |
| 2 | # Create a p12 file from local certs |
| 3 | # |
| 4 | echo "FQI (Fully Qualified Identity): " |
| 5 | read FQI |
| 6 | |
| 7 | if [ "$1" = "" ]; then |
| 8 | MACH=$FQI |
| 9 | else |
| 10 | MACH=$1 |
| 11 | fi |
| 12 | |
| 13 | # Add Cert AND Intermediate CAs (Clients will have Root CAs (or not)) |
| 14 | cat $MACH.crt > $MACH.chain |
Instrumental | 924b18d | 2018-04-05 20:17:18 -0500 | [diff] [blame] | 15 | # Add THIS Intermediate CA into chain |
| 16 | cat "certs/ca.crt" >> $MACH.chain |
Instrumental | 31d847e | 2018-03-26 14:17:19 -0700 | [diff] [blame] | 17 | |
| 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 | |