Browse Source

Add key generation script

develop
Sven Slootweg 8 years ago
parent
commit
258f62af22
  1. 15
      ccollectd/genkey
  2. 15
      cstatsd/genkey

15
ccollectd/genkey

@ -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

@ -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)
Loading…
Cancel
Save