예제 #1
0
def get_dn(cert_file):
    nimbus_home = get_nimbus_home()
    webdir = os.path.join(nimbus_home, "web/")
    if not os.path.exists(webdir):
        raise CLIError("ENIMBUSHOME", "web dir doesn't exist. is this a valid Nimbus install? (%s)" % webdir)
    log = logging.getLogger()
    dn = autoca.getCertDN(cert_file, webdir, log)
    return dn
예제 #2
0
def get_dn(cert_file):
    nimbus_home = get_nimbus_home()
    webdir = os.path.join(nimbus_home, 'web/')
    if not os.path.exists(webdir):
        raise CLIError('ENIMBUSHOME', 
                "web dir doesn't exist. is this a valid Nimbus install? (%s)"
                % webdir)
    log = logging.getLogger()
    dn = autoca.getCertDN(cert_file, webdir, log)
    return dn
예제 #3
0
파일: ezpz_ca.py 프로젝트: Annatara/nimbus
    def get_cert_dn(self, cert):
        """
        Determines the DN of a provided certificate.
        """

        (cert_fd, cert_path) = tempfile.mkstemp(dir=self.tmpdir)

        try:
            cert_file = os.fdopen(cert_fd, 'wb')
            cert_file.write(cert)
            cert_file.close() # make sure write is buffered out

            return autoca.getCertDN(cert_path, self.webdir, self.log)

        finally:
            try:
                os.close(cert_fd)
            except:
                pass # FD may have been never opened-- or closed above

            os.remove(cert_path)
예제 #4
0
    def get_cert_dn(self, cert):
        """
        Determines the DN of a provided certificate.
        """

        (cert_fd, cert_path) = tempfile.mkstemp(dir=self.tmpdir)

        try:
            cert_file = os.fdopen(cert_fd, 'wb')
            cert_file.write(cert)
            cert_file.close()  # make sure write is buffered out

            return autoca.getCertDN(cert_path, self.webdir, self.log)

        finally:
            try:
                os.close(cert_fd)
            except:
                pass  # FD may have been never opened-- or closed above

            os.remove(cert_path)