-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgenpfx
More file actions
29 lines (26 loc) · 790 Bytes
/
genpfx
File metadata and controls
29 lines (26 loc) · 790 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/bin/bash
# A shell script to generate a PFX file with CA-BUNDLE
# Written by: TimVNL
# Version: 20201006
#Set variables
currentdir=$(pwd) # Get Current Working Dir
OUTFILE=$1
PRIVKEY=$2
CERTFILE=$3
CABUNDLE=$4
#script
echo ""
echo "Generating .PFX file with ca-bundle"
echo ""
echo "PFX Information"
echo "------------------------------------"
echo "Certificate directory: $currentdir"
echo "Private key used: $PRIVKEY"
echo "Certificate used: $CERTFILE"
echo "CA-bundle used: $CABUNDLE"
echo "PFX name: $OUTFILE.pfx"
echo "------------------------------------"
echo ""
read -p "Check for errors press [enter] when everything is correct..."
cd $currentdir
openssl pkcs12 -export -out $OUTFILE.pfx -inkey $PRIVKEY -in $CERTFILE -certfile $CABUNDLE