'Given a message with a signature, calculate a new signature
and return whether it matches the signature in the message.
@raises ValueError: if the message has no signature or no signature
can be calculated for it.'

def checkMessageSignature(self, message):

    message_sig = message.getArg(OPENID_NS, 'sig')
    if (not message_sig):
        raise ValueError(('%s    has    no    sig.' % (message,)))
    calculated_sig = self.getMessageSignature(message)
    return (calculated_sig == message_sig)
