'Copies certs and keys into the temporary directory'

def copy_certs_and_keys(self, cert_path, key_path, chain_path=None):

    cert_and_key_dir = os.path.join(self._temp_dir, 'certs_and_keys')
    if (not os.path.isdir(cert_and_key_dir)):
        os.mkdir(cert_and_key_dir)
    cert = os.path.join(cert_and_key_dir, 'cert')
    shutil.copy(cert_path, cert)
    key = os.path.join(cert_and_key_dir, 'key')
    shutil.copy(key_path, key)
    if chain_path:
        chain = os.path.join(cert_and_key_dir, 'chain')
        shutil.copy(chain_path, chain)
    else:
        chain = None
    return (cert, key, chain)
