-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathconvert-p12-to-jks
executable file
·45 lines (39 loc) · 1.13 KB
/
convert-p12-to-jks
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/bin/bash
set -e
# import openssl library
source $(dirname $0)/functions/openssl.sh
source $(dirname $0)/functions/general.sh
function usage() {
echo "Description:"
echo ""
echo "Convert a P12 keystore to a Java keystore store."
echo ""
echo "The resulting Java keystore file will then contain your P12 within the default alias: 1"
echo ""
echo ""
echo "$0 -s <SOURCE KEYSTORE> -d <DESTINATION KEYSTORE> -p <PASSWORD>"
}
while [ "$1" != "" ]; do
case $1 in
-h | --help ) usage
exit
;;
-s | -k | --source_keystore | --keystore ) shift
source_keystore=$1
;;
-d | --destination_keystore ) shift
destination_keystore=$1
;;
-p | --password ) shift
password=$1
;;
* ) usage
exit 1
;;
esac
shift
done
check_param $source_keystore
check_param $destination_keystore
check_param $password
convert_p12_to_jks $source_keystore $destination_keystore $password