diff options
author | Rob Austein <sra@hactrn.net> | 2007-09-29 03:01:58 +0000 |
---|---|---|
committer | Rob Austein <sra@hactrn.net> | 2007-09-29 03:01:58 +0000 |
commit | ad3d45d66c1ec15745695240eb92840b2bddfd8f (patch) | |
tree | 88c6f51e4a2003fc591da330ca9e0594bab22f28 /scripts/pkcs10.py | |
parent | e0feffc3625e1857b070ada86202c0486238a038 (diff) |
Checkpoint
svn path=/scripts/pkcs10.py; revision=1051
Diffstat (limited to 'scripts/pkcs10.py')
-rw-r--r-- | scripts/pkcs10.py | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/scripts/pkcs10.py b/scripts/pkcs10.py index 6578e4be..5636027b 100644 --- a/scripts/pkcs10.py +++ b/scripts/pkcs10.py @@ -7,6 +7,10 @@ list_extensions = False show_attributes = False show_algorithm = False do_verify = True +show_signature = True + +def hexify(thing): + return ":".join(["%02X" % ord(i) for i in thing]) for name in glob.glob("resource-cert-samples/*.req") + glob.glob("biz-certs/*.req"): pkcs10 = rpki.x509.PKCS10_Request(Auto_file = name).get_POWpkix() @@ -19,6 +23,10 @@ for name in glob.glob("resource-cert-samples/*.req") + glob.glob("biz-certs/*.re print pkcs10.signatureAlgorithm.get() print + if show_signature: + print pkcs10.signatureValue, hexify(pkcs10.signatureValue.get()) + print + if show_attributes: print pkcs10.certificationRequestInfo.attributes.oid, pkcs10.certificationRequestInfo.attributes.oid.get() print @@ -50,8 +58,7 @@ for name in glob.glob("resource-cert-samples/*.req") + glob.glob("biz-certs/*.re crit = x.critical.get() value = x.extnValue.get() assert isinstance(value, str) - value = ":".join(["%02X" % ord(i) for i in value]) - print [ name, oid, crit, value ] + print [ name, oid, crit, hexify(value) ] if parse_extensions and exts is not None: @@ -64,7 +71,7 @@ for name in glob.glob("resource-cert-samples/*.req") + glob.glob("biz-certs/*.re if oid in ((1, 3, 6, 1, 5, 5, 7, 1, 7), (1, 3, 6, 1, 5, 5, 7, 1, 8)): continue if isinstance(val, str): - val = ":".join(["%02X" % ord(i) for i in val]) + val = hexify(val) print POW.pkix.oid2obj(oid), oid, "=", val if do_verify: |