diff options
author | Rob Austein <sra@hactrn.net> | 2007-10-09 19:12:06 +0000 |
---|---|---|
committer | Rob Austein <sra@hactrn.net> | 2007-10-09 19:12:06 +0000 |
commit | e7b42b6d2210f8001637758012a24faa70b8aaac (patch) | |
tree | 0cae139c216c98a35930887dccc9b56fb3bfb6dc /scripts/manifests.py | |
parent | 57bb1aa231e7bbc1eafba806bee2b272594a0965 (diff) |
Checkpoint
svn path=/scripts/manifests.py; revision=1135
Diffstat (limited to 'scripts/manifests.py')
-rw-r--r-- | scripts/manifests.py | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/scripts/manifests.py b/scripts/manifests.py new file mode 100644 index 00000000..a48928f8 --- /dev/null +++ b/scripts/manifests.py @@ -0,0 +1,27 @@ +# $Id$ + +import rpki.x509, rpki.manifest, time, POW, POW.pkix, glob + +def onefile(name): + f = open(name) + d = POW.Digest(POW.SHA256_DIGEST) + d.update(f.read()) + f.close() + return name.rpartition("/")[2], d.digest() + +now = time.time() + +mani = rpki.manifest.Manifest() +mani.set((0, # version + 17, # manifestNumber + POW.pkix.time2utc(now), # thisUpdate + POW.pkix.time2utc(now + 24*60*60), # nextUpdate + (2, 16, 840, 1, 101, 3, 4, 2, 1), # id-sha256 + [onefile(i) for i in glob.glob("resource-cert-samples/*.cer")])) + +print mani.get() + +if False: + f = open("manifests.out.der", "w") + f.write(mani.toString()) + f.close() |