summaryrefslogtreecommitdiff
path: root/gecko/gensig.sh
diff options
context:
space:
mode:
authorNick White <git@njw.me.uk>2011-06-16 01:29:43 +0100
committerNick White <git@njw.me.uk>2011-06-16 01:29:43 +0100
commit751f1159831bb0645e019b1fc5581f4cb1e9d9b4 (patch)
tree4a325361f69ebf6ac51fedca21e432e901e222b9 /gecko/gensig.sh
parent335cebf3653b037e43c3e9f28a31696f0b7f1813 (diff)
Basic firefox update support, minor css update
Diffstat (limited to 'gecko/gensig.sh')
-rwxr-xr-xgecko/gensig.sh22
1 files changed, 22 insertions, 0 deletions
diff --git a/gecko/gensig.sh b/gecko/gensig.sh
new file mode 100755
index 0000000..13c0447
--- /dev/null
+++ b/gecko/gensig.sh
@@ -0,0 +1,22 @@
+#!/bin/sh
+#
+# Currently not working - using uhura instead.
+
+if test $# -ne 2; then
+ echo "Usage: $0 update.rdf pem"
+ echo "Outputs a signature suitable for use in update.rdf"
+ exit 1
+fi
+
+# serialise all but the signature entry
+# in mccoy this is serializeResource(), in mexumgen it's ser()
+# exerything else seems to rewrite things, but we *might* get away with sed-ing away the bad line and outputting as rdfxml
+# sha512 hash
+# sign the hash
+# der encode & base64
+
+sed '/em:signature/d' < "$1" | rapper -i turtle -o rdfxml /dev/stdin 2>/dev/null \
+| sha512sum \
+| openssl sha1 -sha1 -binary -sign "$2" \
+| openssl enc -e -a 2>/dev/null \
+| awk '{printf("%s", $0)}' | sed 's/\//\\\//g'