summaryrefslogtreecommitdiff
path: root/tools/certtools.py
diff options
context:
space:
mode:
Diffstat (limited to 'tools/certtools.py')
-rw-r--r--tools/certtools.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/tools/certtools.py b/tools/certtools.py
index 9febc69..82339aa 100644
--- a/tools/certtools.py
+++ b/tools/certtools.py
@@ -761,3 +761,21 @@ def write_file(fn, jsondata):
tempname = fn + ".new"
open(tempname, 'w').write(json.dumps(jsondata))
mv_file(tempname, fn)
+
+def generate_tree_head_signature(signingnodes, own_key,
+ tree_size, timestamp, root_hash):
+ tree_head_signature = None
+ for signingnode in signingnodes:
+ try:
+ tree_head_signature = \
+ create_sth_signature(tree_size, timestamp,
+ root_hash,
+ "https://%s/" % signingnode["address"],
+ key=own_key)
+ break
+ except requests.exceptions.HTTPError, e:
+ logging.warning("create_sth_signature error: %s", e.response)
+ if tree_head_signature == None:
+ logging.error("Could not contact any signing nodes")
+
+ return tree_head_signature