public String calculateServerDigest(boolean passwordAlreadyEncoded, String password) {
        return generateDigest(passwordAlreadyEncoded, username,
                realm, password, httpMethod, uri, qop, nonce, nc, cnonce);
    }
This calculates the server digest value based on user stored password. If the server stores password in clear format
then passwordAlreadyEncoded should be false. If the server stores the password in ha1, digest then the
passwordAlreadyEncoded should be true.

@param passwordAlreadyEncoded false if the server stored password is in clear, true otherwise
@param password user password stored server-side
@return digest value. This value must match the client "response" value in the Authorization http header
for a successful digest authentication
pac4j-http/src/main/java/org/pac4j/http/credentials/DigestCredentials.java