'Create a Response.
:param in_response_to: The session identifier of the request
:param consumer_url: The URL which should receive the response
:param status: The status of the response
:param issuer: The issuer of the response
:param sign: Whether the response should be signed or not
:param to_sign: If there are other parts to sign
:param kwargs: Extra key word arguments
:return: A Response instance'

def _response(self, in_response_to, consumer_url=None, status=None, issuer=None, sign=False, to_sign=None, encrypt_assertion=False, encrypt_cert=None, **kwargs):

    if (not status):
        status = success_status_factory()
    _issuer = self._issuer(issuer)
    response = response_factory(issuer=_issuer, in_response_to=in_response_to, status=status)
    if consumer_url:
        response.destination = consumer_url
    self._add_info(response, **kwargs)
    if ((not sign) and to_sign and (not encrypt_assertion)):
        return signed_instance_factory(response, self.sec, to_sign)
    if encrypt_assertion:
        if sign:
            response.signature = pre_signature_part(response.id, self.sec.my_cert, 1)
        cbxs = CryptoBackendXmlSec1(self.config.xmlsec_binary)
        (_, cert_file) = make_temp(('%s' % encrypt_cert), decode=False)
        response = cbxs.encrypt_assertion(response, cert_file, pre_encryption_part())
        if sign:
            if to_sign:
                signed_instance_factory(response, self.sec, to_sign)
            else:
                sign_class = [(class_name(response), response.id)]
                return signed_instance_factory(response, self.sec, sign_class)
        else:
            return response
    if sign:
        return self.sign(response, to_sign=to_sign)
    else:
        return response
