[9502c50] | 1 | |
---|
| 2 | # alumni2_rt1_typed |
---|
[d5bbd3e] | 3 | |
---|
| 4 | pwd=`pwd` |
---|
[08b8da7] | 5 | eloc=`which abac_prover_yap | sed 's/\/abac_prover_yap//'` |
---|
| 6 | if [ "$eloc" = "" ]; then |
---|
| 7 | echo "ERROR: abac_prover_yap is not in the search path!!!" |
---|
| 8 | exit 1 |
---|
| 9 | fi |
---|
[d5bbd3e] | 10 | keyloc=$pwd |
---|
| 11 | |
---|
| 12 | stateU=`creddy --keyid --cert $keyloc/StateU_ID.pem` |
---|
| 13 | bob=`creddy --keyid --cert $keyloc/Bob_ID.pem` |
---|
| 14 | maryann=`creddy --keyid --cert $keyloc/Maryann_ID.pem` |
---|
| 15 | joe=`creddy --keyid --cert $keyloc/Joe_ID.pem` |
---|
| 16 | |
---|
| 17 | stateU_foundingAlumni="[keyid:$stateU].role:foundingAlumni" |
---|
| 18 | bob_prin="[keyid:$bob]" |
---|
| 19 | maryann_prin="[keyid:$maryann]" |
---|
| 20 | joe_prin="[keyid:$joe]" |
---|
| 21 | |
---|
| 22 | # [keyid:stateU].role:foundingAlumni <-?- [keyid:Bob] (yes) |
---|
| 23 | # [keyid:stateU].role:foundingAlumni <-?- [keyid:Maryann] (no) |
---|
| 24 | # [keyid:stateU].role:foundingAlumni <-?- [keyid:Joe] (no) |
---|
| 25 | |
---|
| 26 | ## dump all credentials |
---|
| 27 | $eloc/abac_prover_yap --keystore $keyloc --dump creds_dump |
---|
| 28 | |
---|
| 29 | # [keyid:stateU].role:foundingAlumni <-?- [keyid:Bob] (yes) |
---|
| 30 | echo " " |
---|
[9502c50] | 31 | echo "===good============ stateU.foundingAlumni <- Bob" |
---|
[d5bbd3e] | 32 | $eloc/abac_prover_yap --keystore $keyloc --role "$stateU_foundingAlumni" --principal "$bob_prin" |
---|
| 33 | |
---|
| 34 | # [keyid:stateU].role:foundingAlumni <-?- [keyid:Maryann] (no) |
---|
| 35 | # asking, isMember(pMaryann,role(pStateU,foundingAlumni),C). |
---|
| 36 | echo " " |
---|
[9502c50] | 37 | echo "===bad============ stateU.foundingAlumni <- Maryann" |
---|
[d5bbd3e] | 38 | $eloc/abac_prover_yap --keystore $keyloc --role "$stateU_foundingAlumni" --principal "$maryann_prin" |
---|
| 39 | |
---|
| 40 | # [keyid:stateU].role:foundingAlumni <-?- [keyid:Joe] (no) |
---|
| 41 | echo " " |
---|
[9502c50] | 42 | echo "===bad============ stateU.foundingAlumni <- Joe" |
---|
[d5bbd3e] | 43 | $eloc/abac_prover_yap --keystore $keyloc --role "$stateU_foundingAlumni" --principal "$joe_prin" |
---|
| 44 | |
---|
| 45 | |
---|