def copy_cert(conf, path):
    cert_file = conf.configuration["CA_default"]["certificate"]

    try:
        with open(cert_file, 'rt') as f:
            cert_str = f.read()
            cert = OpenSSL.crypto.load_certificate(OpenSSL.crypto.FILETYPE_PEM, cert_str)
            cert_hash = format(cert.subject_name_hash(),'x')
    except:
        _log.exception("Failed to get certificate hash")
        raise Exception("Failed to get certificate hash")
    out_file = os.path.join(path, cert_hash + ".0")
    shutil.copyfile(cert_file, out_file)
    return out_file
Return a text representation of the test method.
dataset/ETHPy150Open EricssonResearch/calvin-base/calvin/utilities/certificate.py/copy_cert--crossover with--dataset/ETHPy150Open azoft-dev-team/imagrium/env/Lib/site-packages/unittest_xml_reporting-1.4.3-py2.5.egg/xmlrunner/__init__.py/_TestInfo.get_description