-
Notifications
You must be signed in to change notification settings - Fork 5
/
create-signatures.sh
executable file
·45 lines (36 loc) · 1.71 KB
/
create-signatures.sh
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
#! /bin/sh
# We need to configure this tool with the path to the W3C 'sign-widget.sh'
# and 'validate-widget' tools. Instructions on obtaining these can be found
# on developer.webinos.org, or read the README file.
SIGNER=~/cvs-repos/2006/waf/widgets-digsig/test-suite/tools/sign-widget.sh
VALIDATOR=~/cvs-repos/2006/waf/widgets-digsig/test-suite/tools/validate-widget.sh
# Where are the author and distributor keys?
PWD=`pwd`
AUTHOR_P12=$PWD/example-certs/author.p12
AUTHOR_X509=$PWD/example-certs/author.cert.pem
AUTHOR_PASSWORD=secret
DISTRIBUTOR_P12=$PWD/example-certs/distributor.p12
DISTRIBUTOR_X509=$PWD/example-certs/distributor.cert.pem
DISTRIBUTOR_PASSWORD=secret
# What are we signing?
WIDGET_PATH=$PWD/proximityreminder.wgt
WIDGET_NO_WEBINOSJS_PATH=$PWD/proximityreminder-nowebinosjs.wgt
echo "--------------------------------------"
echo " Creating example author signature "
echo "--------------------------------------"
$SIGNER --pkcs12 $AUTHOR_P12 --pwd $AUTHOR_PASSWORD -a -c $AUTHOR_X509 -o author-signature.xml $WIDGET_PATH
$SIGNER --pkcs12 $AUTHOR_P12 --pwd $AUTHOR_PASSWORD -a -c $AUTHOR_X509 -o author-signature.xml $WIDGET_NO_WEBINOSJS_PATH
if [ $? -ne 0 ]; then
echo "Failed to create and validate author signatures"
exit 500
fi
cd $PWD
echo "--------------------------------------"
echo "Creating example distributor signature"
echo "--------------------------------------"
$SIGNER --pkcs12 $DISTRIBUTOR_P12 --pwd $DISTRIBUTOR_PASSWORD -x -c $DISTRIBUTOR_X509 -o signature1.xml $WIDGET_PATH
$SIGNER --pkcs12 $DISTRIBUTOR_P12 --pwd $DISTRIBUTOR_PASSWORD -x -c $DISTRIBUTOR_X509 -o signature1.xml $WIDGET_NO_WEBINOSJS_PATH
if [ $? -ne 0 ]; then
echo "Failed to create distributor signatures"
exit 500
fi