def generateKeys(devname, length, overwrite): filename = conf.certsDir + "/" + devname + ".key" if not os.path.isfile(filename) or overwrite: certUtils.generatePrivateKey(filename, length) print(devname + " key pair created at " + filename) else: print("Key pair already exists at " + filename + ". Skiping.")
def generateKeys(): try: certUtils.generatePrivateKey(conf.certsDir + "/mosca.key", conf.keyLength) print("mosca key-pair created") except crypto.Error: print("crypto Error: Could not create Keys") exit(-1)
def generateKeys(): if not os.path.isfile(conf.certsDir + 'mosca.key'): certUtils.generatePrivateKey(conf.certsDir + "/mosca.key", conf.keyLength) print "mosca key-pair created"
def generateKeys(): if not os.path.isfile(conf.certsDir + 'iotagent.key'): certUtils.generatePrivateKey(conf.certsDir + "/iotagent.key", conf.keyLength) print "iotagent key pair created"