public static String response(final String authHeaderAlgorithm, final String user, final String realm, final String password,
            final String clientPasswordAlgorithm, final String nonce, final String nc, final String cnonce, final String method, final String uri,
            String body, final String qop) {
        validate(user, realm, password, nonce, method, uri, authHeaderAlgorithm);
        String ha1;

        if (clientPasswordAlgorithm.equalsIgnoreCase("cleartext")) {
            final String a1 = A1(authHeaderAlgorithm, user, realm, password, nonce, cnonce);
            ha1 = H(a1, authHeaderAlgorithm);
        } else {
            ha1 = password;
        }

        final String a2 = A2(authHeaderAlgorithm, method, uri, body, qop);
        if (cnonce != null && qop != null && nc != null && (qop.equalsIgnoreCase("auth") || qop.equalsIgnoreCase("auth-int"))) {
            return KD(ha1, nonce + ":" + nc + ":" + cnonce + ":" + qop + ":" + H(a2, authHeaderAlgorithm), authHeaderAlgorithm);
        } else {
            return KD(ha1, nonce + ":" + H(a2, authHeaderAlgorithm), authHeaderAlgorithm);
        }
    }
public static String response ( final String authHeaderAlgorithm , final String user , final String realm , final String password , final String clientPasswordAlgorithm , final String nonce , final String nc , final String cnonce , final String method , final String uri , String body , final String qop ) { validate ( user , realm , password , nonce , method , uri , authHeaderAlgorithm ) ; String ha1 ; if ( clientPasswordAlgorithm . equalsIgnoreCase ( "cleartext" ) ) { final String a1 = A1 ( authHeaderAlgorithm , user , realm , password , nonce , cnonce ) ; ha1 = H ( a1 , authHeaderAlgorithm ) ; } else { ha1 = password ; } final String a2 = A2 ( authHeaderAlgorithm , method , uri , body , qop ) ; if ( cnonce != null && qop != null && nc != null && ( qop . equalsIgnoreCase ( "auth" ) || qop . equalsIgnoreCase ( "auth-int" ) ) ) { return KD ( ha1 , nonce + ":" + nc + ":" + cnonce + ":" + qop + ":" + H ( a2 , authHeaderAlgorithm ) , authHeaderAlgorithm ) ; } else { return KD ( ha1 , nonce + ":" + H ( a2 , authHeaderAlgorithm ) , authHeaderAlgorithm ) ; } }
@param authHeaderAlgorithm
@param user
@param realm
@param password
@param clientPasswordAlgorithm
@param nonce
@param nc
@param cnonce
@param method
@param uri
@param body
@param qop
@return