Index: examples/passphrase_tests/creddy_prover/acme_rockets_rt0/README
===================================================================
--- examples/passphrase_tests/creddy_prover/acme_rockets_rt0/README	(revision ba6027a0fac78c4a2e819aabd3ccc80779620acc)
+++ examples/passphrase_tests/creddy_prover/acme_rockets_rt0/README	(revision ba6027a0fac78c4a2e819aabd3ccc80779620acc)
@@ -0,0 +1,39 @@
+#!/bin/sh
+#
+# The example makes use of 2 principals, Acme and Coyote.
+#
+# This example shows a very simple delegation of roles by Acme.  Acme's
+# buy_rockets role includes all of Acme's preferred customers.  The example
+# creates the principals and 2 credentials.  Credential 1 encodes the policy
+# that all of Acme's preferred customers can buy rockets from Acme and
+# Credential 2 defines the Coyote as an Acme preferred customer.
+#
+# In addition, Acme principal credential is base on a private key that is
+# encrypted with a passphrase (this is made by using an externally generated
+# private key using openssl)
+# 
+
+# The ./run_query script issues queries to show that the Coyote is both a preferred
+# customer and can buy rockets.  Two invalid queries are also made, checking if
+# Acme is the Coyote's friend, which it isn't and whether a query about
+# something other than a principal works (it doesn't).
+
+# acme_rockets_rt0
+
+creddy --generate --cn Acme --key Acme_private.pem --p=pfile
+creddy --generate --cn Coyote
+
+#[keyid:Acme].role:buy_rockets <- [keyid:Acme].role:preferred_customer 
+# Credential 1
+creddy --attribute \
+       --issuer Acme_ID.pem --key Acme_private.pem --p=pfile --role buy_rockets \
+       --subject-cert Acme_ID.pem --subject-role preferred_customer \
+       --out Acme_buy_rockets__Acme_preferred_customer_attr.der
+
+#[keyid:Acme].role:preferred_customer <- [keyid:Coyote]
+# Credential 2
+creddy --attribute \
+       --issuer Acme_ID.pem --key Acme_private.pem  --p=pfile --role preferred_customer \
+       --subject-cert Coyote_ID.pem \
+       --out Acme_preferred_customer__Coyote_attr.der
+
Index: examples/passphrase_tests/creddy_prover/acme_rockets_rt0/query.save
===================================================================
--- examples/passphrase_tests/creddy_prover/acme_rockets_rt0/query.save	(revision ba6027a0fac78c4a2e819aabd3ccc80779620acc)
+++ examples/passphrase_tests/creddy_prover/acme_rockets_rt0/query.save	(revision ba6027a0fac78c4a2e819aabd3ccc80779620acc)
@@ -0,0 +1,25 @@
+% Restoring file /usr/local/lib/Yap/startup.yss
+  
+===good============ Acme.preferred_customer <- Coyote
+% Restoring file /usr/local/lib/Yap/startup.yss
+YAP query succeed
+prover success!!
+credentials needed :
+ pAcme.preferred_customer  <- pCoyote 
+  
+===good=============== Acme.buy_rockets <- Coyote
+% Restoring file /usr/local/lib/Yap/startup.yss
+YAP query succeed
+prover success!!
+credentials needed :
+ pAcme.buy_rockets  <- pAcme.preferred_customer 
+ pAcme.preferred_customer  <- pCoyote 
+  
+===bad=============== Acme.buy_rockets <- Acme.preferred_customer
+% Restoring file /usr/local/lib/Yap/startup.yss
+fail, a.o <- b.o and a.r <- a.r query is not implemented yet !!!
+  
+===bad=============== Coyote.friend <- Acme
+% Restoring file /usr/local/lib/Yap/startup.yss
+YAP query failed
+prover failed!!
Index: examples/passphrase_tests/creddy_prover/acme_rockets_rt0/run_query
===================================================================
--- examples/passphrase_tests/creddy_prover/acme_rockets_rt0/run_query	(revision ba6027a0fac78c4a2e819aabd3ccc80779620acc)
+++ examples/passphrase_tests/creddy_prover/acme_rockets_rt0/run_query	(revision ba6027a0fac78c4a2e819aabd3ccc80779620acc)
@@ -0,0 +1,48 @@
+
+# acme_rockets_rt0_typed
+
+pwd=`pwd`
+
+eloc=${ABAC_PROVER_PATH}
+keyloc=$pwd
+
+acme=`creddy --keyid --cert $keyloc/Acme_ID.pem`
+coyote=`creddy --keyid --cert $keyloc/Coyote_ID.pem`
+
+preferred_customer="[keyid:$acme].role:preferred_customer"
+buy_rockets="[keyid:$acme].role:buy_rockets"
+coyote_prin="[keyid:$coyote]"
+friend="[keyid:$acme].role:friend"
+acme_prin="[keyid:$acme]"
+
+## dump all credentials
+$eloc/abac_prover_yap  --keystore $keyloc --dump creds_dump
+
+#[keyid:Acme].role:preferred_customer <-?- [keyid:Coyote]
+#isMember(pCoyote, role(pAcme,preferred_customer), C).
+echo "  "
+echo "===good============ Acme.preferred_customer <- Coyote"
+$eloc/abac_prover_yap  --keystore $keyloc \
+      --role "$preferred_customer" --principal "$coyote_prin"
+
+#[keyid:Acme].role:buy_rockets <-?- [keyid:Coyote]
+#isMember(pCoyote, role(pAcme,buy_rockets), C).
+echo "  "
+echo "===good=============== Acme.buy_rockets <- Coyote"
+$eloc/abac_prover_yap  --keystore $keyloc \
+        --role "$buy_rockets" --principal "$coyote_prin"
+
+## this is not suppose to work
+#[keyid:Acme].role:buy_rockets <-?- [keyid:Acme].role:preferred_customer
+echo "  "
+echo "===bad=============== Acme.buy_rockets <- Acme.preferred_customer"
+$eloc/abac_prover_yap  --keystore $keyloc \
+        --role "$buy_rockets" --principal "$preferred_customer"
+
+#[keyid:Coyote].role:friend <-?- [keyid:Acme]
+#isMember(pAcme, role(pCoyote,friend), C).
+echo "  "
+echo "===bad=============== Coyote.friend <- Acme"
+$eloc/abac_prover_yap  --keystore $keyloc \
+        --role "$friend" --principal "$acme_prin"
+
Index: examples/passphrase_tests/creddy_prover/acme_rockets_rt0/run_test
===================================================================
--- examples/passphrase_tests/creddy_prover/acme_rockets_rt0/run_test	(revision ba6027a0fac78c4a2e819aabd3ccc80779620acc)
+++ examples/passphrase_tests/creddy_prover/acme_rockets_rt0/run_test	(revision ba6027a0fac78c4a2e819aabd3ccc80779620acc)
@@ -0,0 +1,16 @@
+#!/bin/sh
+
+env ABAC_CN=1 ./run_query 1 > query.tmp 2>& 1
+
+result=`diff query.tmp query.save 2>/dev/null`
+if [ $? -eq 0 ]; then
+    if [ "$result" = "" ]; then
+       echo "   PASSED"
+    else
+       echo "   ERROR:acme_rockets_rt0 acme_rockets_rt0 creddy_prover result differs!!!"
+    fi
+else
+    echo "   ERROR:acme_rockets_rt0 creddy_prover test result differs!!!"
+fi
+
+
Index: examples/passphrase_tests/creddy_prover/acme_rockets_rt0/setup
===================================================================
--- examples/passphrase_tests/creddy_prover/acme_rockets_rt0/setup	(revision ba6027a0fac78c4a2e819aabd3ccc80779620acc)
+++ examples/passphrase_tests/creddy_prover/acme_rockets_rt0/setup	(revision ba6027a0fac78c4a2e819aabd3ccc80779620acc)
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+rm -rf *.pem *.der
+
+cp ../../PFILE pfile
+cp ../../ENC_PRIVATE.PEM Acme_private.pem
+
+./README
+
Index: examples/passphrase_tests/creddy_prover/run_test
===================================================================
--- examples/passphrase_tests/creddy_prover/run_test	(revision ba6027a0fac78c4a2e819aabd3ccc80779620acc)
+++ examples/passphrase_tests/creddy_prover/run_test	(revision ba6027a0fac78c4a2e819aabd3ccc80779620acc)
@@ -0,0 +1,12 @@
+#!/bin/sh 
+
+pwd=`pwd`
+
+for i in `ls -1 `; do
+    if [ -d $i ]; then
+        printf " ...running on %s\n" "$i"  >& 2;
+        cd $i
+        env ABAC_CN=1 ./run_test
+        cd $pwd
+    fi
+done
Index: examples/passphrase_tests/creddy_prover/setup
===================================================================
--- examples/passphrase_tests/creddy_prover/setup	(revision ba6027a0fac78c4a2e819aabd3ccc80779620acc)
+++ examples/passphrase_tests/creddy_prover/setup	(revision ba6027a0fac78c4a2e819aabd3ccc80779620acc)
@@ -0,0 +1,12 @@
+#!/bin/sh 
+
+pwd=`pwd`
+
+for i in `ls -1 `; do
+    if [ -d $i ]; then
+        printf " ...setup on %s\n" "$i"  >& 2;
+        cd $i
+        ./setup
+        cd $pwd
+    fi
+done
