aboutsummaryrefslogtreecommitdiff
path: root/src/credential/test_credential_own.sh
diff options
context:
space:
mode:
Diffstat (limited to 'src/credential/test_credential_own.sh')
-rwxr-xr-xsrc/credential/test_credential_own.sh58
1 files changed, 14 insertions, 44 deletions
diff --git a/src/credential/test_credential_own.sh b/src/credential/test_credential_own.sh
index 19dd686a9..d2ed0b0ac 100755
--- a/src/credential/test_credential_own.sh
+++ b/src/credential/test_credential_own.sh
@@ -54,6 +54,7 @@ STATE_STUD_ATTR="student"
54REG_STUD_ATTR="student" 54REG_STUD_ATTR="student"
55END_ATTR="end" 55END_ATTR="end"
56 56
57# FORWARD, subject side stored
57SIGNED=`$DO_TIMEOUT gnunet-credential --signSubjectSide --ego=a --attribute="a" --subject="$AKEY b.c" --ttl="2019-12-12 10:00:00"` 58SIGNED=`$DO_TIMEOUT gnunet-credential --signSubjectSide --ego=a --attribute="a" --subject="$AKEY b.c" --ttl="2019-12-12 10:00:00"`
58gnunet-credential --createSubjectSide --ego=a --import "$SIGNED" 59gnunet-credential --createSubjectSide --ego=a --import "$SIGNED"
59gnunet-namestore -D -z a 60gnunet-namestore -D -z a
@@ -79,66 +80,35 @@ gnunet-credential --createSubjectSide --ego=g --import "$SIGNED"
79gnunet-namestore -D -z g 80gnunet-namestore -D -z g
80 81
81 82
82 83# BACKWARD, issuer side stored
83TEST_CREDENTIAL="mygnunetcreds"
84# Own issuer side storage:
85#gnunet-credential --createIssuerSide --ego=epub --attribute="issside" --subject="$EORG_KEY asd" --ttl=5m
86
87#gnunet-namestore -D -z epub
88
89# Own subject side storage:
90#SIGNED=`$DO_TIMEOUT gnunet-credential --signSubjectSide --ego=epub --attribute="abcd" --subject="$EORG_KEY" --ttl="2019-12-12 10:00:00"`
91#gnunet-credential --createSubjectSide --ego=eorg --import "$SIGNED"
92
93#SIGNED=`$DO_TIMEOUT gnunet-credential --signSubjectSide --ego=epub --attribute="abcd" --subject="$EORG_KEY efghijklmno" --ttl="2019-12-12 10:00:00"`
94#gnunet-credential --createSubjectSide --ego=eorg --import "$SIGNED"
95
96#SIGNED=`$DO_TIMEOUT gnunet-credential --signSubjectSide --ego=epub --attribute="abcd" --subject="$EORG_KEY efghijklmno.pqr" --ttl="2019-12-12 10:00:00"`
97#gnunet-credential --createSubjectSide --ego=eorg --import "$SIGNED"
98
99#SIGNED=`$DO_TIMEOUT gnunet-credential --signSubjectSide --ego=epub --attribute="abcd.stu" --subject="$EORG_KEY efghijklmno.pqr" --ttl="2019-12-12 10:00:00"`
100#gnunet-credential --createSubjectSide --ego=eorg --import "$SIGNED"
101
102#SIGNED=`$DO_TIMEOUT gnunet-credential --signSubjectSide --ego=stateu --attribute="aaa" --subject="$EPUB_KEY bbbb" --ttl="2019-12-12 10:00:00"`
103#gnunet-credential --createSubjectSide --ego=epub --import "$SIGNED"
104
105#gnunet-namestore -D -z eorg
106
107# (1) EPub assigns the attribute "discount" to all entities that have been assigned "preferred" by EOrg 84# (1) EPub assigns the attribute "discount" to all entities that have been assigned "preferred" by EOrg
108gnunet-namestore -p -z epub -a -n $DISC_ATTR -t ATTR -V "$EORG_KEY $PREF_ATTR" -e 5m -c test_credential_lookup.conf 85gnunet-credential --createIssuerSide --ego=epub --attribute=$DISC_ATTR --subject="$EORG_KEY $PREF_ATTR" --ttl=5m -c test_credential_lookup.conf
109gnunet-namestore -p -z epub -a -n "random" -t ATTR -V "$GKEY random" -e 5m -c test_credential_lookup.conf
110 86
111# (2) EOrg assigns the attribute "preferred" to all entities that have been assigned "student" by StateU 87# (2) EOrg assigns the attribute "preferred" to all entities that have been assigned "student" by StateU
112gnunet-namestore -p -z eorg -a -n $PREF_ATTR -t ATTR -V "$STATEU_KEY $STATE_STUD_ATTR" -e 5m -c test_credential_lookup.conf 88gnunet-credential --createIssuerSide --ego=eorg --attribute=$PREF_ATTR --subject="$STATEU_KEY $STATE_STUD_ATTR" --ttl=5m -c test_credential_lookup.conf
113 89
114# (3) StateU assigns the attribute "student" to all entities that have been asssigned "student" by RegistrarB 90# (3) StateU assigns the attribute "student" to all entities that have been asssigned "student" by RegistrarB
115gnunet-namestore -p -z stateu -a -n $STATE_STUD_ATTR -t ATTR -V "$REGISTRARB_KEY $REG_STUD_ATTR" -e 5m -c test_credential_lookup.conf 91gnunet-credential --createIssuerSide --ego=stateu --attribute=$STATE_STUD_ATTR --subject="$REGISTRARB_KEY $REG_STUD_ATTR" --ttl=5m -c test_credential_lookup.conf
116 92
117# (4) RegistrarB issues Alice the credential "student" 93# (4) RegistrarB issues Alice the credential "student"
118CRED=`$DO_TIMEOUT gnunet-credential --issue --ego=registrarb --subject=$ALICE_KEY --attribute=$REG_STUD_ATTR --ttl=5m -c test_credential_lookup.conf`
119
120# Alice stores the credential under "mygnunetcreds"
121#gnunet-namestore -p -z alice -a -n $TEST_CREDENTIAL -t CRED -V "$CRED" -e 5m -c test_credential_lookup.conf
122
123SIGNED=`$DO_TIMEOUT gnunet-credential --signSubjectSide --ego=registrarb --attribute="$REG_STUD_ATTR" --subject="$ALICE_KEY" --ttl="2019-12-12 10:00:00"` 94SIGNED=`$DO_TIMEOUT gnunet-credential --signSubjectSide --ego=registrarb --attribute="$REG_STUD_ATTR" --subject="$ALICE_KEY" --ttl="2019-12-12 10:00:00"`
124gnunet-credential --createSubjectSide --ego=alice --import "$SIGNED" 95gnunet-credential --createSubjectSide --ego=alice --import "$SIGNED"
125 96
126# Starting to resolve 97# Starting to resolve
127echo "+++++Starting Collect" 98echo "+++ Starting to Resolve +++"
128 99
129CREDS=`$DO_TIMEOUT gnunet-credential --collect --issuer=$AKEY --attribute="a" --ego=g -c test_credential_lookup.conf | paste -d, -s` 100#CREDS=`$DO_TIMEOUT gnunet-credential --collect --issuer=$AKEY --attribute="a" --ego=g -c test_credential_lookup.conf | paste -d, -s`
130echo $CREDS
131echo gnunet-credential --verify --issuer=$AKEY --attribute="a" --subject=$GKEY --credential=\'$CREDS\' -c test_credential_lookup.conf
132RES_CRED=`gnunet-credential --verify --issuer=$AKEY --attribute="a" --subject=$GKEY --credential="$CREDS" -c test_credential_lookup.conf`
133
134#CREDS=`$DO_TIMEOUT gnunet-credential --collect --issuer=$EPUB_KEY --attribute=$DISC_ATTR --ego=alice -c test_credential_lookup.conf | paste -d, -s`
135#echo $CREDS 101#echo $CREDS
136#echo gnunet-credential --verify --issuer=$EPUB_KEY --attribute=$DISC_ATTR --subject=$ALICE_KEY --credential=\'$CREDS\' -c test_credential_lookup.conf 102#echo gnunet-credential --verify --issuer=$AKEY --attribute="a" --subject=$GKEY --credential=\'$CREDS\' -c test_credential_lookup.conf
137#RES_CRED=`gnunet-credential --verify --issuer=$EPUB_KEY --attribute=$DISC_ATTR --subject=$ALICE_KEY --credential="$CREDS" -c test_credential_lookup.conf` 103#RES_CRED=`gnunet-credential --verify --issuer=$AKEY --attribute="a" --subject=$GKEY --credential="$CREDS" -c test_credential_lookup.conf`
104
105CREDS=`$DO_TIMEOUT gnunet-credential --collect --issuer=$EPUB_KEY --attribute=$DISC_ATTR --ego=alice -c test_credential_lookup.conf | paste -d, -s`
106echo $CREDS
107echo gnunet-credential --verify --issuer=$EPUB_KEY --attribute=$DISC_ATTR --subject=$ALICE_KEY --credential=\'$CREDS\' -c test_credential_lookup.conf
108RES_CRED=`gnunet-credential --verify --issuer=$EPUB_KEY --attribute=$DISC_ATTR --subject=$ALICE_KEY --credential="$CREDS" -c test_credential_lookup.conf`
138 109
139 110
140# Cleanup properly 111# Cleanup properly
141gnunet-namestore -z alice -d -n $TEST_CREDENTIAL -t CRED -e never -c test_credential_lookup.conf
142gnunet-namestore -z epub -d -n $DISC_ATTR -t ATTR -c test_credential_lookup.conf 112gnunet-namestore -z epub -d -n $DISC_ATTR -t ATTR -c test_credential_lookup.conf
143gnunet-namestore -z eorg -d -n $PREF_ATTR -t ATTR -c test_credential_lookup.conf 113gnunet-namestore -z eorg -d -n $PREF_ATTR -t ATTR -c test_credential_lookup.conf
144gnunet-namestore -z stateu -d -n $STATE_STUD_ATTR -t ATTR -c test_credential_lookup.conf 114gnunet-namestore -z stateu -d -n $STATE_STUD_ATTR -t ATTR -c test_credential_lookup.conf