socks
Class UserPasswordAuthentication

java.lang.Object
  extended by socks.UserPasswordAuthentication
All Implemented Interfaces:
Authentication

public class UserPasswordAuthentication
extends java.lang.Object
implements Authentication

SOCKS5 User Password authentication scheme.


Field Summary
static int METHOD_ID
          SOCKS ID for User/Password authentication method
 
Constructor Summary
UserPasswordAuthentication(java.lang.String userName, java.lang.String password)
          Create an instance of UserPasswordAuthentication.
 
Method Summary
 java.lang.Object[] doSocksAuthentication(int methodId, java.net.Socket proxySocket)
          Does User/Password authentication as defined in rfc1929.
 java.lang.String getPassword()
          Get password
 java.lang.String getUser()
          Get the user name.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

METHOD_ID

public static final int METHOD_ID
SOCKS ID for User/Password authentication method

See Also:
Constant Field Values
Constructor Detail

UserPasswordAuthentication

public UserPasswordAuthentication(java.lang.String userName,
                                  java.lang.String password)
Create an instance of UserPasswordAuthentication.

Parameters:
userName - User Name to send to SOCKS server.
password - Password to send to SOCKS server.
Method Detail

getUser

public java.lang.String getUser()
Get the user name.

Returns:
User name.

getPassword

public java.lang.String getPassword()
Get password

Returns:
Password

doSocksAuthentication

public java.lang.Object[] doSocksAuthentication(int methodId,
                                                java.net.Socket proxySocket)
                                         throws java.io.IOException
Does User/Password authentication as defined in rfc1929.

Specified by:
doSocksAuthentication in interface Authentication
Parameters:
methodId - Authentication method selected by the server.
proxySocket - Socket used to conect to the proxy.
Returns:
An array containnig in, out streams, or null if authentication fails.
Throws:
java.io.IOException