#!/usr/bin/env python # Run example # ./scripts/show-verify-key ed25519 0 xjKlejLcLyTQg7Fxy/XGopUeF3W/l3/cRgpFe+edi0E # Use this to generate a signing key and verify key for use in sydent # configurations. # The signing key is generally used in "ed25519.signingkey" in the sydent config import signedjson.key import sys # allow the value to still work if it's entered as three params or one quoted # Canonicalises it here into one string sk_str = ' '.join(sys.argv[1:]) # Then splits back out into 3 sk_parts = sk_str.split(' ',3) signing_key = signedjson.key.decode_signing_key_base64(sk_parts[0],sk_parts[1],sk_parts[2]) print "signing key: %s " % sk_str pk_str = signedjson.key.encode_verify_key_base64(signing_key.verify_key) print "verify key: %s" % pk_str