blob: b202393083efe16a2b6b549c3cf997dd3cfb8adf (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
#!/usr/bin/python
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()
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()
if __name__ == "__main__":
sys.exit(main())
|