-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathchange-password
executable file
·38 lines (32 loc) · 974 Bytes
/
change-password
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
#!/bin/bash
# import openssl library
source $(dirname $0)/functions/openssl.sh
source $(dirname $0)/functions/general.sh
function usage() {
echo "Change the password of a PKCS12 bundle"
echo "Ex:"
echo " $0 -s <SOURCE KEYSTORE> -o <OLD PASSWORD> -n <NEW PASSWORD>"
}
while [ "$1" != "" ]; do
case $1 in
-h | --help ) usage
exit
;;
-s | -k | --keystore | --source_keystore ) shift
source_keystore=$1
;;
-o | --old_password ) shift
old_password=$1
;;
-n | --new_password ) shift
new_password=$1
;;
* ) usage
exit 1
esac
shift
done
check_param $source_keystore
check_param $old_password
check_param $new_password
change_pkcs12_bundle_password $source_keystore $old_password $new_password