Add key generation script

This commit is contained in:
Sven Slootweg 2013-12-07 19:48:02 +01:00
parent 4550e0a425
commit 258f62af22
2 changed files with 30 additions and 0 deletions

15
ccollectd/genkey Executable file
View file

@ -0,0 +1,15 @@
#!/usr/bin/env python2
import yaml, os, stat, binascii
from nacl.public import PrivateKey
privkey = PrivateKey.generate()
pubkey = privkey.public_key
with open("privkey.dat", "w") as f:
f.write(binascii.hexlify(str(privkey)))
with open("pubkey.dat", "w") as f:
f.write(binascii.hexlify(str(pubkey)))
os.chmod("privkey.dat", stat.S_IRUSR | stat.S_IWUSR)

15
cstatsd/genkey Executable file
View file

@ -0,0 +1,15 @@
#!/usr/bin/env python2
import yaml, os, stat, binascii
from nacl.public import PrivateKey
privkey = PrivateKey.generate()
pubkey = privkey.public_key
with open("privkey.dat", "w") as f:
f.write(binascii.hexlify(str(privkey)))
with open("pubkey.dat", "w") as f:
f.write(binascii.hexlify(str(pubkey)))
os.chmod("privkey.dat", stat.S_IRUSR | stat.S_IWUSR)