diff options
author | Magnus Ahltorp <map@kth.se> | 2015-07-31 23:31:24 +0200 |
---|---|---|
committer | Magnus Ahltorp <map@kth.se> | 2015-07-31 23:31:24 +0200 |
commit | fae6b9c78099fa40bcbf9ed451979cdca715fef0 (patch) | |
tree | ca1fb20fc73aabb41c441074f80c52bb8f4f9930 /tools/certtools.py | |
parent | 6d028f7f9d596dc4d7011a9c6e427379d4f59c49 (diff) |
Added storage gc script
Diffstat (limited to 'tools/certtools.py')
-rw-r--r-- | tools/certtools.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/tools/certtools.py b/tools/certtools.py index ed8ab30..dfd5b24 100644 --- a/tools/certtools.py +++ b/tools/certtools.py @@ -15,6 +15,7 @@ import ecdsa import datetime import cStringIO import zipfile +import shutil from certkeys import publickeys def get_cert_info(s): @@ -734,3 +735,11 @@ def extract_original_entry(entry): leaf_cert = precert certchain = decode_certificate_chain(extra_data) return ([leaf_cert] + certchain, timestamp, issuer_key_hash) + +def mv_file(fromfn, tofn): + shutil.move(fromfn, tofn) + +def write_file(fn, sth): + tempname = fn + ".new" + open(tempname, 'w').write(json.dumps(sth)) + mv_file(tempname, fn) |