aboutsummaryrefslogtreecommitdiff
path: root/scripts/manifests.py
diff options
context:
space:
mode:
authorRob Austein <sra@hactrn.net>2007-10-09 20:37:25 +0000
committerRob Austein <sra@hactrn.net>2007-10-09 20:37:25 +0000
commitf0c1805bbb297941fa33d73f16312a5decae12c2 (patch)
tree24661ca4d9e1afd4ad37e95f2784c1412bd213e2 /scripts/manifests.py
parent990108ac97af4fcded70570c3dd22efb0f47cf22 (diff)
Sign the manifest
svn path=/scripts/manifests.py; revision=1142
Diffstat (limited to 'scripts/manifests.py')
-rw-r--r--scripts/manifests.py19
1 files changed, 14 insertions, 5 deletions
diff --git a/scripts/manifests.py b/scripts/manifests.py
index 38c35948..2d5071c2 100644
--- a/scripts/manifests.py
+++ b/scripts/manifests.py
@@ -2,14 +2,23 @@
import rpki.x509, rpki.manifest, time, glob, os
+def dumpasn1(thing):
+ i,o = os.popen4(("dumpasn1", "-a", "-"))
+ i.write(thing)
+ i.close()
+ print "\n".join(x for x in o.read().splitlines() if x.startswith(" "))
+ o.close()
+
m = rpki.x509.SignedManifest()
m.build(serial = 17,
nextUpdate = time.time() + 24 * 60 * 60,
names_and_objs = [(fn, rpki.x509.X509(Auto_file = fn))
for fn in glob.glob("resource-cert-samples/*.cer")])
-i,o = os.popen4(("dumpasn1", "-a", "-"))
-i.write(m.get_content().toString())
-i.close()
-print "\n".join(x for x in o.read().splitlines() if x.startswith(" "))
-o.close()
+#dumpasn1(m.get_content().toString())
+
+m.sign(keypair = rpki.x509.RSA(Auto_file = "biz-certs/Alice-EE.key"),
+ certs = rpki.x509.X509_chain(Auto_files = ("biz-certs/Alice-EE.cer", "biz-certs/Alice-CA.cer")))
+
+print m.get_PEM()
+dumpasn1(m.get_DER())