2 trap "gnunet-arm -e -c test_abd_lookup.conf" SIGINT
4 LOCATION=$(which gnunet-config)
7 LOCATION="gnunet-config"
9 $LOCATION --version 1> /dev/null
12 echo "GNUnet command line tools cannot be found, check environmental variables PATH and GNUNET_PREFIX"
16 rm -rf `gnunet-config -c test_abd_lookup.conf -s PATHS -o GNUNET_HOME -f`
18 # (1) PKEY1.user -> PKEY2.resu.user
19 # (2) PKEY2.resu -> PKEY3
20 # (3) PKEY3.user -> PKEY4
23 which timeout > /dev/null 2>&1 && DO_TIMEOUT="timeout 30"
26 gnunet-arm -s -c test_abd_lookup.conf
27 gnunet-identity -C testissuer -c test_abd_lookup.conf
28 gnunet-identity -C testsubject -c test_abd_lookup.conf
29 SUBJECT_KEY=$(gnunet-identity -d -c test_abd_lookup.conf | grep testsubject | awk '{print $3}')
30 ISSUER_KEY=$(gnunet-identity -d -c test_abd_lookup.conf | grep testissuer | awk '{print $3}')
32 # Get abd and store it with subject (3)
33 SIGNED=`$DO_TIMEOUT gnunet-abd --signSubjectSide --ego=testissuer --attribute=$TEST_ATTR --subject=$SUBJECT_KEY --ttl="2019-12-12 10:00:00" -c test_abd_lookup.conf`
39 echo "Error issuing..."
43 $DO_TIMEOUT gnunet-abd --createSubjectSide --ego=testsubject --import="$SIGNED" --private -c test_abd_lookup.conf
45 gnunet-arm -e -c test_abd_lookup.conf