'Calculate the response for the given challenge'

def getDigestResponse(self, challenge, ncount):

    nonce = challenge.get('nonce')
    algo = challenge.get('algorithm').lower()
    qop = challenge.get('qop')
    ha1 = calcHA1(algo, self.username, self.realm, self.password, nonce, self.cnonce)
    ha2 = calcHA2(algo, 'GET', self.uri, qop, None)
    expected = calcResponse(ha1, ha2, algo, nonce, ncount, self.cnonce, qop)
    return expected
