aboutsummaryrefslogtreecommitdiffstats
path: root/misc/python/test.py
diff options
context:
space:
mode:
authorlloyd <[email protected]>2006-08-23 01:52:04 +0000
committerlloyd <[email protected]>2006-08-23 01:52:04 +0000
commitea756d250a0d12559a02e2e831abd9098607d284 (patch)
tree1396a672d19d345758c61c84ba96354a26fc8a7c /misc/python/test.py
parenta2ceb8f50c45e9ba689c10f87a21442684791c12 (diff)
Updates to the test application
Diffstat (limited to 'misc/python/test.py')
-rwxr-xr-xmisc/python/test.py39
1 files changed, 13 insertions, 26 deletions
diff --git a/misc/python/test.py b/misc/python/test.py
index f6f834003..2876f7667 100755
--- a/misc/python/test.py
+++ b/misc/python/test.py
@@ -2,36 +2,23 @@
import sys, botan
-def do_hash(input):
- pipe = botan.Pipe(botan.Filter("MD5"), botan.Filter("Hex_Encoder"))
-
- print pipe
- pipe.start_msg()
- pipe.write(input)
- pipe.end_msg()
-
- return pipe.read_all()
+class FindDOD(botan.X509_Store.Search_Func):
+ def match(self, cert):
+ return ("PythonCA" in cert.subject_info("Name"))
def main():
cert = botan.X509_Certificate("cert.pem")
- print cert.self_signed
- print cert.is_CA
- print cert.version
- print cert.pathlimit
- print cert.start_time()
- print cert.end_time()
- print cert.subject_info("Name")
- print cert.subject_info("X520.OrganizationalUnit")
- print cert.issuer_info("Name")
- print cert.issuer_info("X520.OrganizationalUnit")
- print cert.policies()
- print cert.ex_constraints()
- print cert.subject_key_id()
- cert2 = botan.X509_Certificate("cert.crt")
- cert3 = botan.X509_Certificate("cert.pem")
- cert4 = botan.X509_Certificate("cert2.crt")
- print cert2 == cert4
+ stor = botan.X509_Store()
+ stor.add_cert(botan.X509_Certificate("cert.pem"), True)
+ stor.add_cert(botan.X509_Certificate("cert2.pem"))
+ stor.add_cert(botan.X509_Certificate("cert.crt"))
+ matcher = FindDOD()
+ certs = stor.get_certs(matcher)
+
+ for cert in certs:
+ print cert.subject_info("Email")
+ print cert.subject_key_id()
if __name__ == "__main__":
sys.exit(main())