'Respond to this request with an X{association}.
@param assoc: The association to send back.
@type assoc: L{openid.association.Association}
@returns: A response with the association information, encrypted
to the consumer\'s X{public key} if appropriate.
@returntype: L{OpenIDResponse}'

def answer(self, assoc):

    response = OpenIDResponse(self)
    response.fields.updateArgs(OPENID_NS, {'expires_in': ('%d' % (assoc.getExpiresIn(),)), 'assoc_type': self.assoc_type, 'assoc_handle': assoc.handle})
    response.fields.updateArgs(OPENID_NS, self.session.answer(assoc.secret))
    if (not ((self.session.session_type == 'no-encryption') and self.message.isOpenID1())):
        response.fields.setArg(OPENID_NS, 'session_type', self.session.session_type)
    return response
