12345678910111213141516171819202122232425262728 |
- #!/usr/bin/env python3
- # Run example
- # ./scripts/generate-key
- # 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
- signing_key = signedjson.key.generate_signing_key(0)
- sk_str = "%s %s %s" % (
- signing_key.alg,
- signing_key.version,
- signedjson.key.encode_signing_key_base64(signing_key)
- )
- pk_str = signedjson.key.encode_verify_key_base64(signing_key.verify_key)
- print(
- "# A new key has been generated. To use it, update your sydent config file with the following: \n"
- "\n"
- "[crypto]\n"
- f"ed25519.signingkey = {sk_str}\n"
- "\n"
- f"# For reference, the public (verificiation) key is {pk_str}\n"
- )
|