'Construct me from an OpenID Message.
@param message: An OpenID check_authentication Message
@type message: L{openid.message.Message}
@returntype: L{CheckAuthRequest}'

def fromMessage(klass, message, op_endpoint=UNUSED):

    self = klass.__new__(klass)
    self.message = message
    self.namespace = message.getOpenIDNamespace()
    self.assoc_handle = message.getArg(OPENID_NS, 'assoc_handle')
    self.sig = message.getArg(OPENID_NS, 'sig')
    if ((self.assoc_handle is None) or (self.sig is None)):
        fmt = '%s    request    missing    required    parameter    from    message    %s'
        raise ProtocolError(message, text=(fmt % (self.mode, message)))
    self.invalidate_handle = message.getArg(OPENID_NS, 'invalidate_handle')
    self.signed = message.copy()
    if self.signed.hasKey(OPENID_NS, 'mode'):
        self.signed.setArg(OPENID_NS, 'mode', 'id_res')
    return self
