Exemple #1
0
def generateCSR(CName):
    try:
        certUtils.generateCSR(CName=CName,
                              privateKeyFile=conf.certsDir + "/mosca.key",
                              csrFileName=conf.certsDir + "/mosca.csr",
                              dnsname=conf.subjectAltNameDnsList)
    except crypto.Error:
        print("crypto Error: Could not create CSR")
        exit(-1)
def generateCSR(devname, overwrite, dns, ip):
    filename = conf.certsDir + "/" + devname + ".csr"
    if not os.path.isfile(filename) or overwrite:
        certUtils.generateCSR(
                CName=devname,
                privateKeyFile=conf.certsDir + "/" + devname + ".key",
                csrFileName=filename,
                dnsname=dns, ipaddr=ip)
    else:
        print("CSR file already exists at " + filename + ". Skiping.")
def generateCSR():
    if not os.path.isfile(conf.certsDir + "/mosca.csr"):
        certUtils.generateCSR(CName='mosca',
                              privateKeyFile=conf.certsDir + "/mosca.key",
                              csrFileName=conf.certsDir + "/mosca.csr",
                              dnsname=conf.subjectAltNameDnsList)
def generateCSR():
    if not os.path.isfile(conf.certsDir + "/iotagent.csr"):
        certUtils.generateCSR(CName='iotagent',
                              privateKeyFile=conf.certsDir + "/iotagent.key",
                              csrFileName=conf.certsDir + "/iotagent.csr",
                              dnsname=['iotagent', 'localhost'])
def generateCSR():
    if not os.path.isfile(conf.certsDir + "/mosca.csr"):
        certUtils.generateCSR(CName='mosca',
                              privateKeyFile=conf.certsDir + "/mosca.key",
                              csrFileName=conf.certsDir + "/mosca.csr",
                              dnsname=['mqtt', 'mosca', 'localhost'])