'Deal with a Response
:param xmlstr: The response as a xml string
:param response_cls: What type of response it is
:param binding: What type of binding this message came through.
:param outstanding_certs: Certificates that belongs to me that the
IdP may have used to encrypt a response/assertion/..
:param kwargs: Extra key word arguments
:return: None if the reply doesn\'t contain a valid SAML Response,
otherwise the response.'

def _parse_response(self, xmlstr, response_cls, service, binding, outstanding_certs=None, **kwargs):

    response = None
    if self.config.accepted_time_diff:
        kwargs['timeslack'] = self.config.accepted_time_diff
    if ('asynchop' not in kwargs):
        if (binding in [BINDING_SOAP, BINDING_PAOS]):
            kwargs['asynchop'] = False
        else:
            kwargs['asynchop'] = True
    if xmlstr:
        if ('return_addrs' not in kwargs):
            if (binding in [BINDING_HTTP_REDIRECT, BINDING_HTTP_POST]):
                try:
                    kwargs['return_addrs'] = self.config.endpoint(service, binding=binding)
                except Exception:
                    logger.info('Not    supposed    to    handle    this!')
                    return None
        try:
            response = response_cls(self.sec, **kwargs)
        except Exception as exc:
            logger.info(('%s' % exc))
            raise
        xmlstr = self.unravel(xmlstr, binding, response_cls.msgtype)
        origxml = xmlstr
        if (not xmlstr):
            return None
        try:
            response = response.loads(xmlstr, False, origxml=origxml)
        except SigverError as err:
            logger.error(('Signature    Error:    %s' % err))
            raise
        except UnsolicitedResponse:
            logger.error('Unsolicited    response')
            raise
        except Exception as err:
            if ('not    well-formed' in ('%s' % err)):
                logger.error('Not    well-formed    XML')
                raise
        logger.debug(('XMLSTR:    %s' % xmlstr))
        if response:
            if outstanding_certs:
                try:
                    cert = outstanding_certs[response.in_response_to]
                except KeyError:
                    key_file = ''
                else:
                    (_, key_file) = make_temp(('%s' % cert['key']), decode=False)
            else:
                key_file = ''
            response = response.verify(key_file)
        if (not response):
            return None
    return response
