aboutsummaryrefslogtreecommitdiffstats
path: root/misc/python/test.py
diff options
context:
space:
mode:
Diffstat (limited to 'misc/python/test.py')
-rwxr-xr-xmisc/python/test.py23
1 files changed, 9 insertions, 14 deletions
diff --git a/misc/python/test.py b/misc/python/test.py
index 2876f7667..c73cc9369 100755
--- a/misc/python/test.py
+++ b/misc/python/test.py
@@ -2,23 +2,18 @@
import sys, botan
-class FindDOD(botan.X509_Store.Search_Func):
- def match(self, cert):
- return ("PythonCA" in cert.subject_info("Name"))
+def do_hash(input):
+ pipe = botan.Pipe(botan.Filter("MD5"), botan.Filter("Hex_Encoder"))
-def main():
- cert = botan.X509_Certificate("cert.pem")
+ print pipe
+ pipe.start_msg()
+ pipe.write(input)
+ pipe.end_msg()
- 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)
+ return pipe.read_all()
- for cert in certs:
- print cert.subject_info("Email")
- print cert.subject_key_id()
+def main():
+ print do_hash("foo")
if __name__ == "__main__":
sys.exit(main())