|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.net.Authenticator
se.entra.phantom.auth.Auth
public class Auth
This class handles user authentication for HTTP/HTTPS connections as well as password processing for SSL certificate files. It also provides a method of passing the current userid/passwords or certificate file password entries for another process, e.g. between NetPhantom Starters and/or NetPhantom Client in order to avoid entering the same UserID/password or just the SSL certificate password again in the new process.
This class sets and handles the Authenticator for HTTP and HTTPS connections in Java 2. For HTTPS this is only supported in JDK 1.4.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class java.net.Authenticator |
|---|
Authenticator.RequestorType |
| Constructor Summary | |
|---|---|
Auth(AuthCB callBack)
Creates the instance of the NetPhantom Authenticator. |
|
| Method Summary | |
|---|---|
void |
addCA(String text)
Adds a CA certificate as accepted for this session. |
void |
addCertPW(String fileName,
String password)
Requests for a password for a client certificate file. |
static Auth |
getAuth()
Gets the single authenticator instance. |
String[] |
getAuth(boolean usesSSL,
String serverName,
String scheme,
String realm)
Requests a password. |
Hashtable<String,String> |
getAuthHeaderTable(Vector headers,
String proxyHost)
Gets a hashtable with token and value pairs from the authentication or proxy authentication header field string. |
String |
getAuthString(String method,
String protocol,
String host,
int port,
String file,
Hashtable<String,String> serverAuth,
String proxyHost)
Requests the authentication header field required to connect to the server in question. |
String |
getAuthString(String method,
URLConnection uc,
String proxyHost)
Requests the authentication header field required to connect to the server in question. |
String |
getAuthString(String method,
URL url,
Hashtable<String,String> serverAuth,
String proxyHost)
Requests the authentication header field required to connect to the server in question. |
String |
getAuthString(String method,
URL url,
String proxyHost)
Requests the authentication header field required to based on a previous successful call for this server. |
String |
getCertPW(String fileName)
Requests for a password for a client certificate file. |
String[] |
getCurrentAuthString(String serverName,
String realm)
Gets the current authentication, if such exists. |
static Hashtable<String,String> |
getFieldValues(String line)
Gets a hashtable with token and value pairs from a header field string. |
String |
getParams()
Creates the string that can be used to pass parameters between a process that has already some definitions of UserID/passwords or just passwords. |
protected PasswordAuthentication |
getPasswordAuthentication()
Called when password authorization is needed. |
void |
initParams(String params)
Initiates the table of previous UserID/password definitions for a server (+ possible realm) or just a file name (for certificate files) from another process. |
boolean |
isAcceptedCA(String text)
Checks if a CA certificate is already accepted for this session. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Auth(AuthCB callBack)
callBack - the callBack interface implementor when
a request for userID/password is requested.| Method Detail |
|---|
public static Auth getAuth()
public static Hashtable<String,String> getFieldValues(String line)
public String getCertPW(String fileName)
public void addCertPW(String fileName,
String password)
public void addCA(String text)
public boolean isAcceptedCA(String text)
public void initParams(String params)
public String getParams()
The data is separated with '/' between each element and the element key/data is separated with '-'.
public String[] getAuth(boolean usesSSL,
String serverName,
String scheme,
String realm)
The following parameters indicates how the process is handled:
server = protocol://serverName[:port],
realm = null | realmString,
server = protocol://serverName[:port],
realm = realmString,
public String getAuthString(String method,
URL url,
String proxyHost)
public String getAuthString(String method,
URLConnection uc,
String proxyHost)
public Hashtable<String,String> getAuthHeaderTable(Vector headers,
String proxyHost)
public String getAuthString(String method,
String protocol,
String host,
int port,
String file,
Hashtable<String,String> serverAuth,
String proxyHost)
public String[] getCurrentAuthString(String serverName,
String realm)
String - - server nameString - - realm
public String getAuthString(String method,
URL url,
Hashtable<String,String> serverAuth,
String proxyHost)
protected PasswordAuthentication getPasswordAuthentication()
getPasswordAuthentication in class Authenticator
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||