'Verify that the credentials represented by this object agree with the
given plaintext C{password} by hashing C{password} in the same way the
response hash represented by this object was generated and comparing
the results.'

def checkPassword(self, password):

    response = self.fields.get('response')
    uri = self.fields.get('uri')
    nonce = self.fields.get('nonce')
    cnonce = self.fields.get('cnonce')
    nc = self.fields.get('nc')
    algo = self.fields.get('algorithm', 'md5').lower()
    qop = self.fields.get('qop', 'auth')
    expected = calcResponse(calcHA1(algo, self.username, self.realm, password, nonce, cnonce), calcHA2(algo, self.method, uri, qop, None), algo, nonce, nc, cnonce, qop)
    return (expected == response)
