Index: examples/python_tests/basic_attribute/Bob_ID.pem
===================================================================
--- examples/python_tests/basic_attribute/Bob_ID.pem	(revision b8a6fd2a19f33adeb601768a49ba56838b38714f)
+++ examples/python_tests/basic_attribute/Bob_ID.pem	(revision b8a6fd2a19f33adeb601768a49ba56838b38714f)
@@ -0,0 +1,19 @@
+-----BEGIN CERTIFICATE-----
+MIIDAjCCAeqgAwIBAgIJAKRwD/pEf2xcMA0GCSqGSIb3DQEBBQUAMA4xDDAKBgNV
+BAMTA0JvYjAeFw0xMjEwMDgyMTE3NDRaFw0xNTA5MjMyMTE3NDRaMA4xDDAKBgNV
+BAMTA0JvYjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAK/dG/YkNo7g
+5+EZH6BD8Mj0qxmfnUugrEPHiQPWlfqOv1hDy6I2nFc0a/2XAefOsis+aefmiCcj
+55zBgyjjnbxVc0madBQd+9cJRaqypjUCsDdhNzDElG0wNdqcjCMBslR9tpb8IU0e
+AvzAZi1RzfpXOpqKb8xiLxHsUK4VS9CGTWP4RPdSCi+n1YMJu/d/X02PYyy+Q4Of
+zJfGMgvZQPFid6wjbvAa+zn0zwGQXXfDK1A9FJpEgxLIgehhQFmXskSlArjlLOa/
+Y4uoikzJGtX/lyWEhagWiF+Malrk93Fg9E7B7NmG+wyR0On9eBYCPs1+byvdmHjt
+NcxFIRGDj5sCAwEAAaNjMGEwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMC
+AQYwHQYDVR0OBBYEFK4FXjnGvidtUt4M/eIrXfmfpwekMB8GA1UdIwQYMBaAFK4F
+XjnGvidtUt4M/eIrXfmfpwekMA0GCSqGSIb3DQEBBQUAA4IBAQCtgdYfKFZAGJhw
+CTK5EnpMOXxjV1Y5GzeY6MegzAHKCofJOywqEmYpuE/b5tqMeVRvpVAA7J8DI/5z
+dX4PttsWNR65EMQfjfS20NoD7LHonhj7wPP/COeXJBTjRBgA7xAO93PLdvH/O2dn
+YwQu6oEMztyb2L9rAbJhUOlP4mDpTyY/k8dYlHezVLKapcUaQhJtCa//3pBuDlrR
+RL+BvlOQAeGrhVtOiltdxpQT1Z3DT3estA8Lm2dGqk8CpjsGtXBzHucK9W5U/HhU
+RAjUnkrk4rLXMN0qwoTTg5LTsUyBkJYy1cqOObyWcF/Bzds/7rcYECiEr7pzRKrF
+kW67CnAU
+-----END CERTIFICATE-----
Index: examples/python_tests/basic_attribute/Bob_private.pem
===================================================================
--- examples/python_tests/basic_attribute/Bob_private.pem	(revision b8a6fd2a19f33adeb601768a49ba56838b38714f)
+++ examples/python_tests/basic_attribute/Bob_private.pem	(revision b8a6fd2a19f33adeb601768a49ba56838b38714f)
@@ -0,0 +1,27 @@
+-----BEGIN RSA PRIVATE KEY-----
+MIIEogIBAAKCAQEAr90b9iQ2juDn4RkfoEPwyPSrGZ+dS6CsQ8eJA9aV+o6/WEPL
+ojacVzRr/ZcB586yKz5p5+aIJyPnnMGDKOOdvFVzSZp0FB371wlFqrKmNQKwN2E3
+MMSUbTA12pyMIwGyVH22lvwhTR4C/MBmLVHN+lc6mopvzGIvEexQrhVL0IZNY/hE
+91IKL6fVgwm7939fTY9jLL5Dg5/Ml8YyC9lA8WJ3rCNu8Br7OfTPAZBdd8MrUD0U
+mkSDEsiB6GFAWZeyRKUCuOUs5r9ji6iKTMka1f+XJYSFqBaIX4xqWuT3cWD0TsHs
+2Yb7DJHQ6f14FgI+zX5vK92YeO01zEUhEYOPmwIDAQABAoIBADwbJxZeVCNLLRVb
+H9sHvYEBVoVAb2NMu/PCe8rLCaGELlO9gBil75NCgHJArU8L7wsmns26lehCtkN2
+RByyhtO6pNeQKYJCqTNaoOvxeSr/CzkyScmqNkyHQLDB9od0af3EpaY+8CbKTh0S
+qRluLycTrxzomcNR/2Jx0TVeY/YVj8OiYU6hDkP9tatYrsxVr9gujOWSzlqc/rCc
+abrmBtPNgU3KgSVDCSS8dIHty9MU6X28KcYVBKabJ35kCYFxKVt1dV0BaoYIWWPw
+biigpniETaMdH40BMt7WxnjP2B7OGKGB6990QrgU0r+fiKiGnrxx9X31uCJnNKj8
+j5VMPXECgYEA2Sr+6tV4CG6JlUIy1n7ELY4PsO0SvWJiB/JYMbUJSHQEPBBEd35k
+OCcETni+WEk2qZmZJruj1qcKSpoSzAfrK/YmC9P299Y0cUNCsMe7eM125IzPODIf
+yswpEvcQx2Rd+/lCHMff3p5dYVvSUkRqRTcWgRlgGJhFH4svDsiV+kkCgYEAz09i
+gwClXZ7sMgvZpi1Z0/N5SJ6mKh72gR3D69fcZa9jruzHlVne606UvDZ1fkNOnJZV
+k7bYaoxFva7Lz0n/VKPifawP2TQ24XS13//Wiyxa9OoqgA5OD2VmxyjfwTREnRyQ
+kD6i2JVjkjzNO1Pb8NIXlZD8IfahfdtOxqkGmsMCgYAMh2t/luM+8Umkv9X5BAVD
+b4++MF9FZ9iqBrRJ4dzwPilEYdfhYPxdNPsNn++zXj32GPN6BZdVOfvhA/STqt1J
+gwD867Sy5bvO0QeW9V7+gDQcyXbnEhU9ePvhqTlhl4vIjr/eszVaPZ67kDWZI3NS
+HPSCbDlcEeTjBf+oBbCJaQKBgC8wfNYhIYNMF6vUsrh2/kmW1HbJVj2kSqxdYCmh
+O1QSNnitAUln6axaeNTW+KvDGnPebKBxMJYgVAe3cEFBMNPNclL1Ba6FijCL5pKU
+o/uOHy4812vK1c3/YQPYtAZApZW12Npcx6jRaJbzLCxjDF+nEyNCm4IHp/8EGsxx
+0UUNAoGAZBQibAA6cVM+C9NXtI1pfUU2dzOoFCxNpuNZRa5LIBg0AQrER+nCEj2s
+65RtmpKdy83x8l+lw878HRw3v3H/BrWgla7wJzMUETrmUrsPp4QusEWShhfxvEm6
+U34qgTV3ERw9guYpavSI2QEuq/S+vu5cfSljc3J3M2y7KRgqOS4=
+-----END RSA PRIVATE KEY-----
Index: examples/python_tests/basic_attribute/Jack_ID.pem
===================================================================
--- examples/python_tests/basic_attribute/Jack_ID.pem	(revision b8a6fd2a19f33adeb601768a49ba56838b38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jvcmO6i7sx0aI+1+7suWy2
+MUFZMgC2ePLISFSUUV6+O7NjAklBEIKKduSvacHvJIbe9fcT8tE3qrD6hwAJfjmK
+Hz7+5R79GQ==
+-----END CERTIFICATE-----
Index: examples/python_tests/basic_attribute/Jack_private.pem
===================================================================
--- examples/python_tests/basic_attribute/Jack_private.pem	(revision b8a6fd2a19f33adeb601768a49ba56838b38714f)
+++ examples/python_tests/basic_attribute/Jack_private.pem	(revision b8a6fd2a19f33adeb601768a49ba56838b38714f)
@@ -0,0 +1,27 @@
+-----BEGIN RSA PRIVATE KEY-----
+MIIEowIBAAKCAQEAzAc6juKP7uys4nU1rJI8TEz4N3kWLAinqEd/yroL9oLGi44g
+0ZfIA1Dj2IlflN9z9bBm4A/4TOL9ZTPuLQEHpblP9IUUbYERm3MpuyjJ/L3zQ3Va
+kBsleLoqxLq56DrVf7xWJbaRLfSVJJTFyu4e9LYKdFR0c445S662Eupo+LQJO4je
+eKeDQnknpEDk7DwlmHT5U60mfZ7CfDAuP3JyoO5r/waRX9M0q+yzNMuSk8imgmzg
+Z8oFKywlmoA0AYOQmL6n12S0Gr07PQ8OWTGH4FBnmW+KAi3z3ITh2OHBiO9EzqPp
+RxTee1pQtn0UsEVbEDAGuJAVIND8cWVjIOxCkwIDAQABAoIBAExUL/4gmIRkGtGl
+0+y50MEi0oG+VSMoIcD87rwjGjKg/jJbe7+trvA+pN7vlciWSEWUNwiAMP5itTXV
+VbeUeQ3w5A6wctH8xV+ImAYi3l4lmgqUrsrWvRALZdCvorlUuWbOSNRXFr1AkUNc
+PRsMNpyKNiMLLX3FqX284PT2qUrRNMZ5p8J/caK5sEakG3yNggii04TnLVy6lDUf
+Fx/94T3dvcxMLEd/5ay0O0+eFgUQQctoHUjQ1Cq+Juy6bdlxw6GoDR6X9bV9eFhb
+HuKbCzoI4+CAnFS7udj6YgheSK3nzvTscCMXLZzDBVwqVxih+0aDoszeoyTBzKUN
+k+C3SXECgYEA65Racu2DyUxVYi5UN7vv440+Q6jXX/jSffWfZNRST7GP2O4eyktV
+SEZ8i0B/rd1DwNjBL6ognjvs17pgm9PVEYcu/MKjvEUdofNvbdwFsRHbwBAfYFUg
+HzgtEALK2YiQb3+wOg3EnzBwV99k+ZhY2AgO7kpNQW0UQxxrm4WnfU0CgYEA3ba8
+AHSy9XmlBjbViYj/MevBaQ1EuNdzsdlqDAXQP2E7aWJJBaB8szFGOT8lY8A0rZNZ
+HQHtAn5fl5pRz6Tc3Ywv7ywsPSulwsh9s1lLr9QHtfOkb7PHEwLQR+ttnu5iqqiQ
+xfhQIq8ffi8oxyKaweIdB82IjcsdqtSboZOCT18CgYEAvtoTZORzTdOfoMjzxatm
+Ly2wcdQJmGDW9uDU3zT78kBhz1cqbq0VTFZ+c7ovNkX5q/RunhTwFAFsYWFG/zdg
+eLDSKkftqos79IZpkdEcc1WKeFEXek28lk5Gg6AfgpiWmx4RQRcCYg02FpqPDX6V
+C3+LyRU8/XJHZg9SRk7DYEkCgYBdcjVO4+DBgaHCOr5Jl4onmjwMcOE0HurOXNpL
+cu/QpsSJqDkqu/eS9wOoAStbHZmWRvJaPYONd4IGva4ZnFzSq9FQNwf2SD03GZWR
+T+OMmgsd7zCxO859/sOWbG3pfIPtddp+9iegVrspTesb80PSz+B4d3JEgQViCPYH
+ZcqYdQKBgFnq/zu3I4BR2rFxeTV2TJmA9iea1x1GDlax9SlYiydmOE1AGeK64BCp
+AYznydafE5BqRMruc5u3VX06bKIEQqrfNE28+c/zqZSCtL3WPphpnAEvX7bqaE8A
++GOVhsZyammzjoGMiMPq/3VOt9D4EIEw6mflmA+D/a3cMcizAkw4
+-----END RSA PRIVATE KEY-----
Index: examples/python_tests/basic_attribute/Mary_ID.pem
===================================================================
--- examples/python_tests/basic_attribute/Mary_ID.pem	(revision b8a6fd2a19f33adeb601768a49ba56838b38714f)
+++ examples/python_tests/basic_attribute/Mary_ID.pem	(revision b8a6fd2a19f33adeb601768a49ba56838b38714f)
@@ -0,0 +1,19 @@
+-----BEG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oiMEr17M=
+-----END CERTIFICATE-----
Index: examples/python_tests/basic_attribute/Mary_private.pem
===================================================================
--- examples/python_tests/basic_attribute/Mary_private.pem	(revision b8a6fd2a19f33adeb601768a49ba56838b38714f)
+++ examples/python_tests/basic_attribute/Mary_private.pem	(revision b8a6fd2a19f33adeb601768a49ba56838b38714f)
@@ -0,0 +1,27 @@
+-----BEGIN RSA PRIVATE KEY-----
+MIIEowIBAAKCAQEAnjGzkUjBRj+UGKQ5UtANyQp6ReI95JerjbcdWsm7TpSlN3Sg
+rHMSsgOj641w304p9+hYNmvRxjO7BYNhAtkTImaDS3/IzsZtS8pf+0GHXr65hABk
+iiaBnTt/0cpbSybDVtzg3hVBz5Aj2w/Q6f+lOvhZcvPDUv6lRHz3+2pffVXBPHDY
+ulvNanMS0WnoUKPJOgz3oyk9bFmVCl3CqunI6TjZV5IHGQS8v/8TVU4ly/lUfjhG
+VsnCxeDmwMgOrVPmLvLEPY78SJqhOq3m4hPa70Ofa9yFlIAbav+8uja6zCiq9+OY
+7dybtpLIzyTkiqTJSN/PxFePObSWHztn96vDiQIDAQABAoIBAESPP8agZHtAhLul
+ON7GIqNVsiZlZfOTNBuIF+XH9jCZRX1iQ1xZxul1oG4u75Mn+hJiFREI63Jd6xj5
+lmq4j41iJlbrO6k54BZvz+dBwBx0xkwKK4igJZ5yMfRHIgfQ9enIcoBtcAc37gI7
+uYwgaojDJ2klciqfCBtFmefRcy8K8+mUH/R5SM89w/oljTjjiFJRBcgIk+VpgTZe
+YFeQyLzL4i+Buqr9OyjojbYsdixuE5ppV+3BN6LSgMniiW9SO75rcU46ctROSCcz
+8y7C0l6BPvz4FFHvO6OStFoOM7o28V/eMXESxmCfJ0FRzalduPaDEmhapQbi8JUn
+aTOfvP0CgYEAzb4a9F02OxGpIoCHwCpedXMu5FX8VcYei4a8b2BpcNl2Fz/oRs+P
+lDnQPFzM6oKnOvwOJAK7CidSNlIKNphkOlvyr/IWx8agfkGwOIvE9xfBvb+T5PhP
+/C+LZ/zygCxmqdkMnGHj4o66FCpAWBMTE/PdvX3YvL/YKWjTpBUwKV8CgYEAxNY0
+RvrrY6wOVBL3qviczD0bj+YEUcLTXxqhghsStutnvBYPPMdj2gupOTUSTchHBa8m
+TOodpwQwLlVie+x8/xvTIh1qJzKSBZOQsyJ92zRND2UIxpdhBaeb4Z3jBjoaB8PN
+Ulcid9DdcEsTjWckzwbBeZkb+xD+WIpQKmQHdBcCgYByGi5ku5Up6T997P5caqL8
+TCcDZ1SMVVX3V4AF3NhdR50gg8bUDqS4Nd/wuh7DKDaKleNZwVHt7aTAj3sukBF1
+9CyBu6c6oEO+AbwzgAB6cOh3zVm+MKBbYhrUTwpGX1mIdOFzkS6LJVC5gj0xG1MH
+S8X8I2EiPNsrDAHkDAQrzQKBgHpXoTqU7wWOhYFgIKwVxm9zc9Qm5XxkGbi89rHF
+XgZvnpRbKbFfRQLbyJyUDgJmfy5bRPT9dty+T6wcyg+4V6DAjKRhn/8pAXWR2Jhe
+0dcTVOpCpAe7Q0SeftbmqZrPNiqpWs7Y9cV+/oOzRj3XZBuBWXPY5HlSgKRLo7QV
+ZESVAoGBAJu8LVY2qNRVyKpKAd/3Ge0wtLwM4Vdeop5n7EWyXeXxw42xQhj8YIGV
+IrQdNAARZq1NhVbpvRN8PM9C0kAjHcCYkDw1EJ1DnJykqrNC332bJtNRBCc7ScBX
+B2H9iO3Y4UEsHrOBgmJdXuq88nwaSpPMxqpx7k8PyIbeqCXFvcwi
+-----END RSA PRIVATE KEY-----
Index: examples/python_tests/basic_attribute/README
===================================================================
--- examples/python_tests/basic_attribute/README	(revision b8a6fd2a19f33adeb601768a49ba56838b38714f)
+++ examples/python_tests/basic_attribute/README	(revision b8a6fd2a19f33adeb601768a49ba56838b38714f)
@@ -0,0 +1,22 @@
+#####################################################################
+# This example demonstrates various ways to create and access
+# ID attribute using libabac api
+#  
+
+case 1: make attribute rule
+        writing attribute cert file
+        load attribute cert
+
+case 2: make attribute rule
+        load attribute
+
+case 3: make attribute rule
+        retrieve attribute cert chunk
+        make new attribute with cert chunk
+        load new attribute
+
+case 4: make attribute rule
+        retrieve attribute cert chunk
+        load attribute cert chunk directly into context
+
+
Index: examples/python_tests/basic_attribute/SuperK_ID.pem
===================================================================
--- examples/python_tests/basic_attribute/SuperK_ID.pem	(revision b8a6fd2a19f33adeb601768a49ba56838b38714f)
+++ examples/python_tests/basic_attribute/SuperK_ID.pem	(revision b8a6fd2a19f33adeb601768a49ba56838b38714f)
@@ -0,0 +1,19 @@
+-----BEGIN CERTIFICATE-----
+MIIDBzCCAe+gAwIBAgIILRfxR9djPekwDQYJKoZIhvcNAQEFBQAwETEPMA0GA1UE
+AxMGU3VwZXJLMB4XDTEyMTAwODIxMTc0MFoXDTE1MDkyMzIxMTc0MFowETEPMA0G
+A1UEAxMGU3VwZXJLMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAyPsl
+GuFHdFFKKLFeXGFjJjnRF2n6oO4Omrxc2YeBxfQ5sAlDfNsH+Jv1fbJBUh0tnYlp
++E/S4fOc9zONomDUqst3NMXlQDgp+qyw1XKeoMBLKDCHaE1QpAF6VQi38O07wFvD
+9a3XmYTPEIxc17or1EOo/6vgu8pjoXF76ikVaZOPeuAnh8snXsnDybKc8mf+FvBL
+izbyPwuvb0cIQVr3Bb+uGk2pGjWyzmvvLGEaOEE1pUhdl35vuiWSUDWxD0MD/P39
+eM2JEIFDjPsVkcq0jczctGXUtkbyhKMqIMxKHnvIMpAD4RgFDtsgCnRvyTPly+C6
+EcRm1XuQJavPs601xwIDAQABo2MwYTAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB
+/wQEAwIBBjAdBgNVHQ4EFgQUe4HVF8es5SmEu+YF/lhMpLfz8w4wHwYDVR0jBBgw
+FoAUe4HVF8es5SmEu+YF/lhMpLfz8w4wDQYJKoZIhvcNAQEFBQADggEBAFxVswM8
+QJCxoec5Z5XFS3N4VZK6eoBqFEg4VQg/CEH1RskQTazpXAbBQCcWtueXQLL4CrDy
+IrWS8Qf5Fnu/reqID0mbsPPjIYe6A4nkb6VPs4yPiYycNBVQmWMDSfqwlS+hnh82
++cqsndlBIquQe2LxjxaecXdcpX5NfK13yE7GT0tpAgfBfTkYIucuOLyGPZPGxsUT
+Js1e6eN2t+sEyad2kH2dR9KPTLXJF23F70KscHGBQhBXO2VJbgGPMFC2G96GGtCa
+YFFkHPFQ12Q9+6po749ZD5ussLt0Ly7xZ5XG1OivffmHIi/waRje5WHDhDVRA+RZ
+EG1yLm4UWWg020k=
+-----END CERTIFICATE-----
Index: examples/python_tests/basic_attribute/SuperK_private.pem
===================================================================
--- examples/python_tests/basic_attribute/SuperK_private.pem	(revision b8a6fd2a19f33adeb601768a49ba56838b38714f)
+++ examples/python_tests/basic_attribute/SuperK_private.pem	(revision b8a6fd2a19f33adeb601768a49ba56838b38714f)
@@ -0,0 +1,27 @@
+-----BEGIN RSA PRIVATE KEY-----
+MIIEpAIBAAKCAQEAyPslGuFHdFFKKLFeXGFjJjnRF2n6oO4Omrxc2YeBxfQ5sAlD
+fNsH+Jv1fbJBUh0tnYlp+E/S4fOc9zONomDUqst3NMXlQDgp+qyw1XKeoMBLKDCH
+aE1QpAF6VQi38O07wFvD9a3XmYTPEIxc17or1EOo/6vgu8pjoXF76ikVaZOPeuAn
+h8snXsnDybKc8mf+FvBLizbyPwuvb0cIQVr3Bb+uGk2pGjWyzmvvLGEaOEE1pUhd
+l35vuiWSUDWxD0MD/P39eM2JEIFDjPsVkcq0jczctGXUtkbyhKMqIMxKHnvIMpAD
+4RgFDtsgCnRvyTPly+C6EcRm1XuQJavPs601xwIDAQABAoIBAFyRV/i2c/u+CSMO
+9oAkFs+fZ4+aL2Z53t4kDbvfLsVnBD7xNVVHaLd31a0MMgvJBp59kQJeeam6U7yD
+0SNN6AW2avQyhbF7bNJZQaU+ApPVnYgoOeWvXon7aEXMGzRrf87MNUhtxlSeF+Tu
+UUDHLbK5axg/KOY1hIfyRfmG7KbQD/2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AmVhUZWl1m4PuM2Kfg==
+-----END RSA PRIVATE KEY-----
Index: examples/python_tests/basic_attribute/attr.cn
===================================================================
--- examples/python_tests/basic_attribute/attr.cn	(revision b8a6fd2a19f33adeb601768a49ba56838b38714f)
+++ examples/python_tests/basic_attribute/attr.cn	(revision b8a6fd2a19f33adeb601768a49ba56838b38714f)
@@ -0,0 +1,14 @@
+case1 rule set...
+..pSuperK.park<-pSuperK.employee 
+case2 rule set...
+....pSuperK.park<-pSuperK.employee 
+....pSuperK.employee<-pJack 
+case3 rule set...
+....pSuperK.park<-pSuperK.employee 
+....pSuperK.employee<-pJack 
+....pSuperK.employee<-pBob 
+case4 rule set...
+......pSuperK.park<-pSuperK.employee 
+......pSuperK.employee<-pJack 
+......pSuperK.employee<-pBob 
+......pSuperK.employee<-pMary 
Index: examples/python_tests/basic_attribute/attr.py
===================================================================
--- examples/python_tests/basic_attribute/attr.py	(revision b8a6fd2a19f33adeb601768a49ba56838b38714f)
+++ examples/python_tests/basic_attribute/attr.py	(revision b8a6fd2a19f33adeb601768a49ba56838b38714f)
@@ -0,0 +1,111 @@
+#!/usr/bin/env python
+
+"""
+  to test with python
+
+cmd1:env keystore=`pwd` ./attr.py 
+
+"""
+
+import os
+import ABAC
+
+ctxt = ABAC.Context()
+
+def print_p(ctxt, tt, msg):
+    os.environ["ABAC_CN"]="1"
+    out = ctxt.context_principals()
+    print "%s principal set..." % tt
+    for x in out[1]:
+        print "%s%s " % (msg,x.string())
+    os.environ.clear()
+
+def print_a(ctxt, tt, msg):
+    os.environ["ABAC_CN"]="1"
+    print "%s rule set..." % tt
+    out = ctxt.context_credentials()
+    for x in out[1]:
+        print "%s%s " % (msg,x.string())
+    os.environ.clear()
+
+##wrint db with ABAC_CN enabled
+def print_db(ctxt):
+    ctxt.dump_yap_db()
+
+# Keystore is the directory containing the principal credentials.
+# Load existing principals and/or policy credentials
+if (os.environ.has_key("keystore")) :
+    keystore=os.environ["keystore"]
+else:
+    print("keystore is not set...")
+    exit(1) 
+
+superKID=ABAC.ID("SuperK_ID.pem");
+superKID.id_load_privkey_file("SuperK_private.pem");
+ctxt.load_id(superKID)
+superK=superKID.id_keyid()
+
+jackID=ABAC.ID("Jack_ID.pem");
+jackID.id_load_privkey_file("Jack_private.pem");
+ctxt.load_id(jackID)
+jack=jackID.id_keyid()
+
+bobID=ABAC.ID("Bob_ID.pem");
+bobID.id_load_privkey_file("Bob_private.pem");
+ctxt.load_id(bobID)
+bob=bobID.id_keyid()
+
+maryID=ABAC.ID("Mary_ID.pem");
+maryID.id_load_privkey_file("Mary_private.pem");
+ctxt.load_id(maryID)
+mary=maryID.id_keyid()
+
+#case 1:
+#Only employee of SuperK can park
+#[keyid:SuperK].role:park <- [keyid:SuperK].role:employee
+head = ABAC.Role(superK,"park")
+tail = ABAC.Role(superK,"employee")
+attr=ABAC.Attribute(head, 1800)
+attr.attribute_add_tail(tail)
+attr.attribute_bake()
+attr.attribute_write_cert("SuperK_park__SuperK_employee_attr.der")
+ctxt.load_attribute_file("SuperK_park__SuperK_employee_attr.der")
+print_a(ctxt,"case1", "..")
+
+#case 2:
+#Jack is an employee of SuperK
+#[keyid:SuperK].role:employee <- [keyid:Jack]
+head = ABAC.Role(superK,"employee")
+tail = ABAC.Role(jack)
+attr=ABAC.Attribute(head, 1800)
+attr.attribute_add_tail(tail)
+attr.attribute_bake()
+# create a policy file at the file system
+attr.attribute_write_cert("SuperK_employee__Jack_attr.der")
+ctxt.load_attribute(attr);
+print_a(ctxt,"case2", "....")
+
+#case 3:
+#Bob is an employee of SuperK
+#[keyid:SuperK].role:employee <- [keyid:Jack]
+head = ABAC.Role(superK,"employee")
+tail = ABAC.Role(bob)
+attr=ABAC.Attribute(head, 1800)
+attr.attribute_add_tail(tail)
+attr.attribute_bake()
+chunk=attr.cert_chunk()
+nattr=ABAC.Attribute_chunk(chunk)
+ctxt.load_attribute(nattr);
+print_a(ctxt,"case3", "....")
+
+#case 4:
+#Mary is an employee of SuperK
+#[keyid:SuperK].role:employee <- [keyid:Mary]
+head = ABAC.Role(superK,"employee")
+tail = ABAC.Role(mary)
+attr=ABAC.Attribute(head, 1800)
+attr.attribute_add_tail(tail)
+attr.attribute_bake()
+chunk=attr.cert_chunk()
+ctxt.load_attribute_chunk(chunk);
+print_a(ctxt,"case4", "......")
Index: examples/python_tests/basic_attribute/attr.save
===================================================================
--- examples/python_tests/basic_attribute/attr.save	(revision b8a6fd2a19f33adeb601768a49ba56838b38714f)
+++ examples/python_tests/basic_attribute/attr.save	(revision b8a6fd2a19f33adeb601768a49ba56838b38714f)
@@ -0,0 +1,14 @@
+case1 rule set...
+..pSuperK.park<-pSuperK.employee 
+case2 rule set...
+....pSuperK.park<-pSuperK.employee 
+....pSuperK.employee<-pJack 
+case3 rule set...
+....pSuperK.park<-pSuperK.employee 
+....pSuperK.employee<-pJack 
+....pSuperK.employee<-pBob 
+case4 rule set...
+......pSuperK.park<-pSuperK.employee 
+......pSuperK.employee<-pJack 
+......pSuperK.employee<-pBob 
+......pSuperK.employee<-pMary 
Index: examples/python_tests/basic_attribute/run_test
===================================================================
--- examples/python_tests/basic_attribute/run_test	(revision b8a6fd2a19f33adeb601768a49ba56838b38714f)
+++ examples/python_tests/basic_attribute/run_test	(revision b8a6fd2a19f33adeb601768a49ba56838b38714f)
@@ -0,0 +1,26 @@
+#!/bin/sh 
+
+g_cmd_cn=`grep "cmd1:" attr.py |sed "s/cmd1://g" `
+
+echo '---setup principals'
+./setup.py 1>attr.log 2>&1
+
+echo '---run command '
+eval $g_cmd_cn 1>attr.cn 2>&1
+
+result=`diff attr.cn attr.save 2>/dev/null`
+if [ $? -eq 0 ]; then
+    if [ "$result" = "" ]; then
+       echo "   PASSED"
+    else
+       echo "   ERROR:basic_attribute test result differs!!!"
+    fi
+else
+    echo "   ERROR:basic_attribute test result differs!!!"
+fi
+
+
+
+
+
+
Index: examples/python_tests/basic_attribute/setup.py
===================================================================
--- examples/python_tests/basic_attribute/setup.py	(revision b8a6fd2a19f33adeb601768a49ba56838b38714f)
+++ examples/python_tests/basic_attribute/setup.py	(revision b8a6fd2a19f33adeb601768a49ba56838b38714f)
@@ -0,0 +1,28 @@
+#!/usr/bin/env python
+
+"""
+See README for the semantics.  This creates principals
+using ID and write out the credential file pair, cert/privkey
+"""
+import os
+import ABAC
+
+ctxt = ABAC.Context()
+
+jackID=ABAC.ID("SuperK", 0)
+jackID.id_write_cert("SuperK_ID.pem")
+jackID.id_write_privkey("SuperK_private.pem")
+
+jackID=ABAC.ID("Jack", 0)
+jackID.id_write_cert("Jack_ID.pem")
+jackID.id_write_privkey("Jack_private.pem")
+
+bobID=ABAC.ID("Bob", 0)
+bobID.id_write_cert("Bob_ID.pem")
+bobID.id_write_privkey("Bob_private.pem")
+
+maryID=ABAC.ID("Mary", 0)
+maryID.id_write_cert("Mary_ID.pem")
+maryID.id_write_privkey("Mary_private.pem")
+
+
