def decrypt_text(project_id, text):
    private_key_file = key_path(project_id)
    if not os.path.exists(private_key_file):
        raise exception.ProjectNotFound(project_id=project_id)
    with open(private_key_file, 'rb') as f:
        data = f.read()
    try:
        priv_key = serialization.load_pem_private_key(
            data, None, backends.default_backend())
        return priv_key.decrypt(text, padding.PKCS1v15())
    except (ValueError, __HOLE__, exceptions.UnsupportedAlgorithm) as exc:
        raise exception.DecryptionFailure(reason=six.text_type(exc))
dataset/ETHPy150Open openstack/nova/nova/crypto.py/decrypt_text