1 | rm -rf creds_dump |
---|
2 | |
---|
3 | pwd=`pwd` |
---|
4 | |
---|
5 | #eloc=/home/mei/Deter/abac/libabac |
---|
6 | eloc=$pwd/../../libabac |
---|
7 | #keyloc=/home/mei/Deter/abac/examples/alumni3_rt1_typed |
---|
8 | keyloc=$pwd |
---|
9 | |
---|
10 | stateU=`creddy --keyid --cert $keyloc/StateU_ID.pem` |
---|
11 | |
---|
12 | bob=`creddy --keyid --cert $keyloc/Bob_ID.pem` |
---|
13 | mark=`creddy --keyid --cert $keyloc/Mark_ID.pem` |
---|
14 | joe=`creddy --keyid --cert $keyloc/Joe_ID.pem` |
---|
15 | maryann=`creddy --keyid --cert $keyloc/Maryann_ID.pem` |
---|
16 | jan=`creddy --keyid --cert $keyloc/Jan_ID.pem` |
---|
17 | |
---|
18 | stateU_foundingAlumni="[keyid:$stateU].role:foundingAlumni" |
---|
19 | bob_prin="[keyid:$bob]" |
---|
20 | maryann_prin="[keyid:$maryann]" |
---|
21 | joe_prin="[keyid:$joe]" |
---|
22 | mark_prin="[keyid:$mark]" |
---|
23 | jan_prin="[keyid:$jan]" |
---|
24 | |
---|
25 | # [keyid:stateU].role:foundingAlumni <-?- [keyid:Bob] (yes) |
---|
26 | # [keyid:stateU].role:foundingAlumni <-?- [keyid:Mark] (no) |
---|
27 | # [keyid:stateU].role:foundingAlumni <-?- [keyid:Joe] (no) |
---|
28 | # [keyid:stateU].role:foundingAlumni <-?- [keyid:Maryann] (no) |
---|
29 | # [keyid:stateU].role:foundingAlumni <-?- [keyid:Jan] (yes) |
---|
30 | |
---|
31 | ## dump all credentials |
---|
32 | $eloc/abac_prover_yap --keystore $keyloc --dump creds_dump |
---|
33 | |
---|
34 | # [keyid:stateU].role:foundingAlumni <-?- [keyid:Bob] (yes) |
---|
35 | echo " " |
---|
36 | echo "===good============ stateU.foundingAlumni <- Bob yap " |
---|
37 | $eloc/abac_prover_yap --keystore $keyloc --role "$stateU_foundingAlumni" --principal "$bob_prin" |
---|
38 | |
---|
39 | # [keyid:stateU].role:foundingAlumni <-?- [keyid:Mark] (no) |
---|
40 | echo " " |
---|
41 | echo "===bad============ stateU.foundingAlumni <- Mark yap " |
---|
42 | $eloc/abac_prover_yap --keystore $keyloc --role "$stateU_foundingAlumni" --principal "$mark_prin" |
---|
43 | |
---|
44 | # [keyid:stateU].role:foundingAlumni <-?- [keyid:Joe] (no) |
---|
45 | echo " " |
---|
46 | echo "===bad============ stateU.foundingAlumni <- Joe yap " |
---|
47 | $eloc/abac_prover_yap --keystore $keyloc --role "$stateU_foundingAlumni" --principal "$joe_prin" |
---|
48 | |
---|
49 | # [keyid:stateU].role:foundingAlumni <-?- [keyid:Maryann] (no) |
---|
50 | # asking, isMember(pMaryann,role(pStateU,foundingAlumni),C). |
---|
51 | echo " " |
---|
52 | echo "===bad============ stateU.foundingAlumni <- Maryann yap " |
---|
53 | $eloc/abac_prover_yap --keystore $keyloc --role "$stateU_foundingAlumni" --principal "$maryann_prin" |
---|
54 | |
---|
55 | # [keyid:stateU].role:foundingAlumni <-?- [keyid:Jan] (yes) |
---|
56 | echo " " |
---|
57 | echo "===good============ stateU.foundingAlumni <- Jan yap " |
---|
58 | $eloc/abac_prover_yap --keystore $keyloc --role "$stateU_foundingAlumni" --principal "$jan_prin" |
---|
59 | |
---|
60 | |
---|