common/src/main/java/HTTPClient/DefaultAuthHandler.java
/*
     * Here are all the Digest specific methods
     */
Here are all the Digest specific methods
Here are all the Digest specific methods
private static AuthorizationInfo digest_gen_auth_info(String host, int port,
							  String realm,
							  String user,
							  String pass,
							  Object context)
    {
	String A1 = user + ":" + realm + ":" + pass;
	String[] info = { MD5.hexDigest(A1), null, null };
	AuthorizationInfo prev = AuthorizationInfo.getAuthorization(host, port,
						    "Digest", realm, context);
	NVPair[] params;
	if (prev == null)
	{
	    params = new NVPair[4];
	    params[0] = new NVPair("username", user);
	    params[1] = new NVPair("uri", "");
	    params[2] = new NVPair("nonce", "");
	    params[3] = new NVPair("response", "");
	}
	else
	{
	    params = prev.getParams();
	    for (int idx=0; idx<params.length; idx++)
	    {
		if (params[idx].getName().equalsIgnoreCase("username"))
		{
		    params[idx] = new NVPair("username", user);
		    break;
		}
	    }
	}
	return new AuthorizationInfo(host, port, "Digest", realm, params, info);
    }
private static AuthorizationInfo digest_gen_auth_info ( String host , int port , String realm , String user , String pass , Object context ) { String A1 = user + ":" + realm + ":" + pass ; String [ ] info = { MD5 . hexDigest ( A1 ) , null , null } ; AuthorizationInfo prev = AuthorizationInfo . getAuthorization ( host , port , "Digest" , realm , context ) ; NVPair [ ] params ; if ( prev == null ) { params = new NVPair [ 4 ] ; params [ 0 ] = new NVPair ( "username" , user ) ; params [ 1 ] = new NVPair ( "uri" , "" ) ; params [ 2 ] = new NVPair ( "nonce" , "" ) ; params [ 3 ] = new NVPair ( "response" , "" ) ; } else { params = prev . getParams ( ) ; for ( int idx = 0 ; idx < params . length ; idx ++ ) { if ( params [ idx ] . getName ( ) . equalsIgnoreCase ( "username" ) ) { params [ idx ] = new NVPair ( "username" , user ) ; break ; } } } return new AuthorizationInfo ( host , port , "Digest" , realm , params , info ) ; }
Here are all the Digest specific methods
Here are all the Digest specific methods