Add the Synapse signing key generator
This commit is contained in:
parent
ff8ca55027
commit
868bd9e1da
15
scripts/gen_synapse_key.py
Normal file
15
scripts/gen_synapse_key.py
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
import random
|
||||||
|
import string
|
||||||
|
import io
|
||||||
|
from signedjson.key import generate_signing_key, write_signing_keys
|
||||||
|
|
||||||
|
|
||||||
|
def random_string(length):
|
||||||
|
return ''.join(random.choice(string.ascii_letters) for _ in range(length))
|
||||||
|
|
||||||
|
|
||||||
|
key_id = "a_" + random_string(4)
|
||||||
|
with io.StringIO() as f:
|
||||||
|
write_signing_keys(f, (generate_signing_key(key_id),),)
|
||||||
|
f.seek(0)
|
||||||
|
print(f.read())
|
Loading…
Reference in New Issue
Block a user