Index: examples/example_scripts/python/IceCream_ID.pem
===================================================================
--- examples/example_scripts/python/IceCream_ID.pem	(revision ba6027a0fac78c4a2e819aabd3ccc80779620acc)
+++ 	(revision )
@@ -1,19 +1,0 @@
------BEGIN CERTIFICATE-----
-MIIDCzCCAfOgAwIBAgIIYWmVNsrLroowDQYJKoZIhvcNAQEFBQAwEzERMA8GA1UE
-AxMISWNlQ3JlYW0wHhcNMTIwODA0MDM0NjA4WhcNMTUwNzIwMDM0NjA4WjATMREw
-DwYDVQQDEwhJY2VDcmVhbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEB
-AK6zVvhBJZ01kyEw/Z8XC49VDTjrsuKzlC5zfD4JV1IHktzOwoc05oxPMYW+SshL
-37CRc+MBa/giPYxy08BWlnF/qsdqPwQPNZpORdkwMtQkGBIVkqWN+LkssjHbzJTj
-zGG678zLRslGa7W082L2eKr9EwV/yiooZFfKNcKehLtDJRQUrPitwRvcmW0DUAoz
-im+4F3eP5tEISVvDgUmneiiNoldD1bCqWpAO9y2bpgBCOf3x/rfB6TDWcHFG+LIB
-d8oXxcCSesOFqz9Twv3RkNa06sctet8bXY/mbl6uUvx1H7uyLsHUqcnylQKhisIU
-jfS6DIBGE4kg/wdFcexCrskCAwEAAaNjMGEwDwYDVR0TAQH/BAUwAwEB/zAOBgNV
-HQ8BAf8EBAMCAQYwHQYDVR0OBBYEFOp5Vugz4M66LXF/ZF7S414MJ/QKMB8GA1Ud
-IwQYMBaAFOp5Vugz4M66LXF/ZF7S414MJ/QKMA0GCSqGSIb3DQEBBQUAA4IBAQCo
-iXog4DmsZiJpeHYKGTsvAXL1cXmPQSoLvX/S7VOYt16/YqElm2pGH+VVSl1b5mdJ
-FlHEnqI/DmPPqUTy5dSOyTvEqIQamQUlrzFdY7vJRjNQ9854DufofEUXVDkd3hnj
-Qng4/2cKsdsDjgNP4i9+Pmo/vVqEuZa4S4W3I+tW/jEYCEnJUZ49XSLPWT1xrdPm
-FOAiNw4Ih/FU0mOQxSUIX8AQJgqIe8CHsr1FOCMAla3mDFzGY/nZIAhfVBeHwLk8
-A0iMwhJoK6/ayTtHXsB9nv2rYezKb1TepG/7rafOkAxug7atk+Wt+v+V09mS+aIu
-Tlhv0qOxpoxm8b3EzLQK
------END CERTIFICATE-----
Index: examples/example_scripts/python/IceCream_private.pem
===================================================================
--- examples/example_scripts/python/IceCream_private.pem	(revision ba6027a0fac78c4a2e819aabd3ccc80779620acc)
+++ 	(revision )
@@ -1,27 +1,0 @@
------BEGIN RSA PRIVATE KEY-----
-MIIEpQIBAAKCAQEArrNW+EElnTWTITD9nxcLj1UNOOuy4rOULnN8PglXUgeS3M7C
-hzTmjE8xhb5KyEvfsJFz4wFr+CI9jHLTwFaWcX+qx2o/BA81mk5F2TAy1CQYEhWS
-pY34uSyyMdvMlOPMYbrvzMtGyUZrtbTzYvZ4qv0TBX/KKihkV8o1wp6Eu0MlFBSs
-+K3BG9yZbQNQCjOKb7gXd4/m0QhJW8OBSad6KI2iV0PVsKpakA73LZumAEI5/fH+
-t8HpMNZwcUb4sgF3yhfFwJJ6w4WrP1PC/dGQ1rTqxy163xtdj+ZuXq5S/HUfu7Iu
-wdSpyfKVAqGKwhSN9LoMgEYTiSD/B0Vx7EKuyQIDAQABAoIBAQCONsPnl/Dsxz4c
-WOs9ZN8uMQhwe77FuXY5Uh2jyqrgxfWR9mZ49mFvetBPlZb+8nUIIX/7HZ8tAYKl
-IJysCFCz2D/H0f+2aEM0d994bDoUY8WMgy87whTleTMeT1V9Juur6ydmyVu4YbEw
-3Dr9JrMYTqf7ZAnIw9TbemrFIZHfdfIdYrjiGEqQirGaDYqjSH/dBCdqHqi5Eree
-WdH/0F+NbYH2opyf9vyPrBVUUgGegl/Pn22EW7KJXIt8Lx+s+V1CI4I70I7svHQD
-8Hj1l3Ch0775Bc5A52pImA6Gtnw+dH5/iVIsPlfkWt8QVb3KwhNjx+ugIv2lOzLP
-gVcvnwoBAoGBAOQnk6THZNXaARlLQru9ePy7K9p33Djb7MgVzgnyUPL1jMWFrRDY
-AXVbFUlmwRZNd95ZMLwiDm2HiEwy6kX5xFP13O1ER9TEFge4koCc46mEHWMBA1nI
-RmkCu1A+updxH5VkmKMTN3Z+/zU9U8OzseXnH6qRpAbLXN4qfJrBoMNpAoGBAMQF
-p1xzRKedFJobet0Flx2sFUp9q/gWAjarsJPE7KNKZVE6ydt5KW9fLgkF6zjVXlUl
-e6+blAeF4KU0YNg+VS3og6WOtsshyWfP3M7XDBqy6kqDQphxlSr8T0YXtocmVO5j
-idKFBxy6FI3A9kzf1y66gYUCSOKUoRvUijxmkwRhAoGBAKVT0Hc9TeJxQQ6VLNxi
-ZkOtVg/PfzNsml46/rzSbLpCGSogvdJQ1G23/OrdnNmOdWgX9Wq+uvm/lpKw6nae
-kRfON7NvISYamWQq6W5tQcPaynitiUIMEImTwyxY6FlJTfuxk7HIAQ7K5CAuOn67
-vhO8sYOmWdfakYcj/nseCGLRAoGBAIA+Iqw9TWFLRzs7Vzpaee8Tsio15dg8rd4O
-nUtPvnFmLrrh90X7ErymTHviv21DSp/yEeVlp4b0c3AhwGo4/Yk3YUljAPwMcrPU
-LeW0k1q0SsvM7DjHtouU3lhBE02AKnh77qMoHOsSYngLEhhhKWqM4keeowh5rJ2E
-g5vYj76BAoGAcIYNCEYzwmJrOrx6AlaA1JAfJm8ECSsEV0KcGbf9I+35pu7XOg7z
-nsOwzg4FmBk6I859uM2xHYbNN1wHD9G+U2By14D3gW1cRgDYGnRgYmSdxrOAZSdn
-rgb3cSk4TjWZZUFzIvtYfezP+nOy0e5G0q+F/LPWCEtxHnit9QDAR1U=
------END RSA PRIVATE KEY-----
Index: examples/example_scripts/python/Makefile
===================================================================
--- examples/example_scripts/python/Makefile	(revision ba6027a0fac78c4a2e819aabd3ccc80779620acc)
+++ examples/example_scripts/python/Makefile	(revision 519e487487fcfb946577db4296eba5a2ee83c27c)
@@ -1,2 +1,5 @@
+
+all: run_attr run_e_attr run_id run_id2 run_prove
+
 clean:
 	rm -f *.pem *.der 
@@ -5,9 +8,12 @@
 	rm -f *.pem *.der *.log pfile
 
+setup:
+	creddy --generate --cn IceCream
+	creddy --generate --cn Chocolate
+
 run_attr: 
 	make clean
 	rm -rf attr.log
-	creddy --generate --cn IceCream
-	creddy --generate --cn Chocolate
+	make setup
 	./abac_attr.py IceCream_ID.pem IceCream_private.pem IceCream_attr.der Chocolate_ID.pem 1>attr.log 2>&1
 
@@ -24,5 +30,5 @@
 	make clean
 	rm -rf id.log
-	creddy --generate --cn IceCream
+	make setup
 	./abac_keyid.py IceCream_ID.pem 1>id.log 2>&1
                              
@@ -30,4 +36,9 @@
 	make clean
 	rm -rf id2.log
-	creddy --generate --cn IceCream
+	make setup
 	./abac_keyid.py IceCream_private.pem 1>id2.log 2>&1
+
+run_prove:
+	rm -rf prover.log
+	make run_attr
+	./run_prover 1>prover.log 2>& 1
Index: examples/example_scripts/python/abac_attr.py
===================================================================
--- examples/example_scripts/python/abac_attr.py	(revision ba6027a0fac78c4a2e819aabd3ccc80779620acc)
+++ examples/example_scripts/python/abac_attr.py	(revision 519e487487fcfb946577db4296eba5a2ee83c27c)
@@ -1,27 +1,26 @@
 #!/usr/bin/env python
 
-/**
-   abac_attr.py
+"""
+     abac_attr.py
 
-   To demonstrate how to use ABAC's api in C
-
-   call:   attr_abac IceCream_ID.pem IceCream_private.pem IceCream_attr.der Chocolate_ID.pem
-
-   pre-conditions: generate IceCream_ID.pem and IceCream_private.pem with
-           creddy --generate --cn IceCream
-                   generate Chocolate_ID.pem and Chocolate_private.pem with
-           creddy --generate --cn Chocolate
-
-   This program will generate an attribute rule, write it out to an external
-           file and also load it into the context (prolog db)
-           [keyid:IceCream].delicious <- [Keyid:Chocolate]
-
-   Then, a query is made against the context to see if it is populated correctly.
-
-   Note: Chocolate's principal is loaded without it private key. It does not
-         need to because it is not being used to generate attribute credential
-
-**/
-
+     To demonstrate how to use ABAC's api in python 
+  
+     call:   attr_abac IceCream_ID.pem IceCream_private.pem IceCream_attr.der Chocolate_ID.pem
+  
+     pre-conditions: generate IceCream_ID.pem and IceCream_private.pem with
+             creddy --generate --cn IceCream
+                     generate Chocolate_ID.pem and Chocolate_private.pem with
+             creddy --generate --cn Chocolate
+  
+     This program will generate an attribute rule, write it out to an external
+             file and also load it into the context (prolog db)
+             [keyid:IceCream].delicious <- [Keyid:Chocolate]
+  
+     Then, a query is made against the context to see if it is populated correctly.
+  
+     Note: Chocolate's principal is loaded without it private key. It does not
+           need to because it is not being used to generate attribute credential
+  
+"""
 
 from sys import argv, exit
@@ -34,4 +33,6 @@
 ctxt = Context()
 
+print len(argv)
+
 if len(argv) != 5:
     print "Usage: abac_attr.py <cert.pem> <key.pem> <attr.der> <pcert.pem>"
@@ -40,8 +41,10 @@
 # load the ID and its key
 id = None
+cid = None
+
 try:
     id = ID(argv[1])
     id.id_load_privkey_file(argv[2])
-    chocolate_id = ID(argv[4])
+    cid = ID(argv[4])
 except Exception, e:
     print "Problem loading ID cert: %s" % e
@@ -56,5 +59,5 @@
 # another way to load the id into the context
 #ctxt.load_id(id)
-ctxt.load_id(chocolate_id)
+ctxt.load_id(cid)
 
 if debug :
@@ -77,5 +80,5 @@
 # iceCream.delicous <- chocolate
 head= Role(id.id_keyid(),"delicious")
-tail= Role(chocolate_id.id_keyid())
+tail= Role(cid.id_keyid())
 
 attr = Attribute(head, 1800)
@@ -98,5 +101,5 @@
 # run a proof
 role = Role(id.id_keyid(),"delicious")
-p=Role(chocolate_id.id_keyid())
+p=Role(cid.id_keyid())
 
 out = ctxt.query(role, p)
Index: examples/example_scripts/python/abac_e_attr.py
===================================================================
--- examples/example_scripts/python/abac_e_attr.py	(revision ba6027a0fac78c4a2e819aabd3ccc80779620acc)
+++ examples/example_scripts/python/abac_e_attr.py	(revision 519e487487fcfb946577db4296eba5a2ee83c27c)
@@ -1,8 +1,8 @@
 #!/usr/bin/env python
 
-/**
+"""
    abac_e_attr.py
 
-   To demonstrate how to use ABAC's api in C with principal credential that uses
+   To demonstrate how to use ABAC's api in python with principal credential that uses
    encrypted private key
 
@@ -25,5 +25,5 @@
          need to because it is not being used to generate attribute credential
 
-**/
+"""
 
 
Index: examples/example_scripts/python/abac_keyid.py
===================================================================
--- examples/example_scripts/python/abac_keyid.py	(revision ba6027a0fac78c4a2e819aabd3ccc80779620acc)
+++ examples/example_scripts/python/abac_keyid.py	(revision 519e487487fcfb946577db4296eba5a2ee83c27c)
@@ -1,9 +1,8 @@
 #!/usr/bin/env python
 
-/**
-
+"""
   abac_keyid.py
 
-   To demonstrate how to use ABAC's api in C to access keyid of a 
+   To demonstrate how to use ABAC's api in python to access keyid of a 
 principal credential
 
@@ -13,6 +12,5 @@
    keyid of the loaded principal credential is printed
 
-**/
-
+"""
 
 from sys import argv, exit
Index: examples/example_scripts/python/abac_prover.py
===================================================================
--- examples/example_scripts/python/abac_prover.py	(revision 519e487487fcfb946577db4296eba5a2ee83c27c)
+++ examples/example_scripts/python/abac_prover.py	(revision 519e487487fcfb946577db4296eba5a2ee83c27c)
@@ -0,0 +1,69 @@
+#!/usr/bin/env python
+
+"""
+   abac_prover.py
+    
+   To demonstrate how to use ABAC's api in python to make a query
+
+   call:   abac_prover "keystorestring" "rolestring" "principalstring"
+
+   pre-condition: run make attr_abac  generate IceCream_ID.pem and IceCream_private.pem with
+
+   This program will make a prover call using
+           rolestring <- principalstring
+
+"""
+
+import getopt
+import sys
+from ABAC import Context
+
+
+def usage():
+    print "Usage: abac_prover.py \\"
+    print "        --keystore <keystore> \\"
+    print "        --role <role> --principal <principal> "
+    print "    loads the keystore and runs the query role <-?- principal"
+    sys.exit(1)
+
+keystore = ''
+role = ''
+principal = ''
+
+try:
+    opts, args = getopt.getopt(sys.argv[1:], '', ['keystore=', 'role=', 'principal='])
+except getopt.GetoptError, err:
+    print str(err)
+    sys.exit(1)
+
+for o, a in opts:
+    if o == '--keystore':
+        keystore = a
+    elif o == '--role':
+        role = a
+    elif o == '--principal':
+        principal = a
+    else:
+        assert False, "WAT"
+
+if keystore == '' or role == '' or principal == '':
+    usage()
+
+# code begins here! sorry about that
+
+print keystore
+print role
+print principal
+
+ctx = Context()
+ctx.load_directory(keystore)
+
+(success, credentials) = ctx.query(role, principal)
+
+if success:
+    print "success"
+
+for credential in credentials:
+    print "credential %s <- %s" % (credential.head_string(), credential.tail_string())
+
+
Index: examples/example_scripts/python/attr.log
===================================================================
--- examples/example_scripts/python/attr.log	(revision ba6027a0fac78c4a2e819aabd3ccc80779620acc)
+++ 	(revision )
@@ -1,4 +1,0 @@
-  File "./abac_attr.py", line 3
-    /**
-    ^
-SyntaxError: invalid syntax
Index: examples/example_scripts/python/e_attr.log
===================================================================
--- examples/example_scripts/python/e_attr.log	(revision ba6027a0fac78c4a2e819aabd3ccc80779620acc)
+++ 	(revision )
@@ -1,4 +1,0 @@
-  File "./abac_e_attr.py", line 3
-    /**
-    ^
-SyntaxError: invalid syntax
Index: examples/example_scripts/python/id.log
===================================================================
--- examples/example_scripts/python/id.log	(revision ba6027a0fac78c4a2e819aabd3ccc80779620acc)
+++ 	(revision )
@@ -1,4 +1,0 @@
-  File "./abac_keyid.py", line 3
-    /**
-    ^
-SyntaxError: invalid syntax
Index: examples/example_scripts/python/id2.log
===================================================================
--- examples/example_scripts/python/id2.log	(revision ba6027a0fac78c4a2e819aabd3ccc80779620acc)
+++ 	(revision )
@@ -1,4 +1,0 @@
-  File "./abac_keyid.py", line 3
-    /**
-    ^
-SyntaxError: invalid syntax
Index: examples/example_scripts/python/pfile
===================================================================
--- examples/example_scripts/python/pfile	(revision ba6027a0fac78c4a2e819aabd3ccc80779620acc)
+++ 	(revision )
@@ -1,1 +1,0 @@
-dumdum
Index: examples/example_scripts/python/run_prover
===================================================================
--- examples/example_scripts/python/run_prover	(revision 519e487487fcfb946577db4296eba5a2ee83c27c)
+++ examples/example_scripts/python/run_prover	(revision 519e487487fcfb946577db4296eba5a2ee83c27c)
@@ -0,0 +1,13 @@
+#!/bin/sh
+
+keystore=`pwd`
+pID=`creddy --keyid --cert ${keystore}/IceCream_ID.pem`
+cID=`creddy --keyid --cert ${keystore}/Chocolate_ID.pem`
+
+role="[keyid:${pID}].role:delicious"
+principal="[keyid:${cID}]"
+
+./abac_prover.py --keystore "$keystore" --role "$role" --principal "$principal"
+
+
+
Index: examples/example_scripts/python/run_test
===================================================================
--- examples/example_scripts/python/run_test	(revision ba6027a0fac78c4a2e819aabd3ccc80779620acc)
+++ examples/example_scripts/python/run_test	(revision 519e487487fcfb946577db4296eba5a2ee83c27c)
@@ -36,2 +36,12 @@
    echo "   PASSED"
 fi
+
+
+echo '---running (python) prover script'
+make run_prove 1>/dev/null 2>& 1
+result=`grep "YAP query succeed" prover.log 2>/dev/null`
+if [ "$result" = "" ]; then
+   echo "   ERROR"
+else   
+   echo "   PASSED"
+fi
