def verify(self, key_file=""):
        """ Verify that the assertion is syntactically correct and
        the signature is correct if present.
        :param key_file: If not the default key file should be used this is it.
        """

        try:
            res = self._verify()
        except __HOLE__ as err:
            logger.error("Verification error on the response: %s" % err)
            raise
        else:
            if res is None:
                return None

        if not isinstance(self.response, samlp.Response):
            return self

        if self.parse_assertion(key_file):
            return self
        else:
            logger.error("Could not parse the assertion")
            return None
dataset/ETHPy150Open cloudera/hue/desktop/core/ext-py/pysaml2-2.4.0/src/saml2/response.py/AuthnResponse.verify