|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.eu.mayrhofer.authentication.AuthenticationEventSender
org.eu.mayrhofer.authentication.HostProtocolHandler
public class HostProtocolHandler
This class handles the key agreement protocol between two hosts on the TCP/IP level. It implements both sides of the protocol, allowing to handle incoming connections (i.e. incoming authentication requests) as well as initiating outgoing connections (i.e. outgoing authentication requests). Events are raised upon authentication success, failure and during the progress of an authentication protocol. The authentication success event generated by this protocol will return an InetAddress object for the remote parameter and an Object array as the result parameter. This object array will always have at least 3 objects: two byte arrays representing the session key and the authentication key and a String representing the optional parameter that might have been specified by the client or which might have been passed to the protocol when in client mode. This third object in the object array can be null if no parameter was specified, but it will always be there. An optional fourth object will be included with the array when the keepSocketConnected flag was set. This fourth paramater will then contain the still connected socket object.
| Field Summary | |
|---|---|
static int |
AuthenticationStages
At the moment, the whole protocol consists of 4 stages. |
static java.lang.String |
Protocol_AuthenticationAcknowledge
|
static java.lang.String |
Protocol_AuthenticationRequest
|
static java.lang.String |
Protocol_AuthenticationRequest_Param
This is an optional field in the authentication request line, where the client can pass parameters to the next authentication protocol. |
static java.lang.String |
Protocol_Hello
These are the messages of the ASCII authentication protocol. |
| Fields inherited from class org.eu.mayrhofer.authentication.AuthenticationEventSender |
|---|
eventsHandlers |
| Method Summary | |
|---|---|
static void |
startAuthenticationWith(java.lang.String remoteAddress,
int remotePort,
AuthenticationProgressHandler eventHandler,
boolean keepSocketConnected,
java.lang.String optionalParameter,
boolean useJSSE)
Outgoing authentication connections are done asynchronously just like the incoming connections. |
| Methods inherited from class org.eu.mayrhofer.authentication.AuthenticationEventSender |
|---|
addAuthenticationProgressHandler, raiseAuthenticationFailureEvent, raiseAuthenticationProgressEvent, raiseAuthenticationSuccessEvent, removeAuthenticationProgressHandler |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String Protocol_Hello
public static final java.lang.String Protocol_AuthenticationRequest
Protocol_Hello,
Constant Field Valuespublic static final java.lang.String Protocol_AuthenticationRequest_Param
Protocol_AuthenticationRequest,
Constant Field Valuespublic static final java.lang.String Protocol_AuthenticationAcknowledge
Protocol_Hello,
Constant Field Valuespublic static final int AuthenticationStages
| Method Detail |
|---|
public static void startAuthenticationWith(java.lang.String remoteAddress,
int remotePort,
AuthenticationProgressHandler eventHandler,
boolean keepSocketConnected,
java.lang.String optionalParameter,
boolean useJSSE)
throws java.net.UnknownHostException,
java.io.IOException
remoteAddress - The remote host to try to connect to.remotePort - The remote TCP port to try to connect to.eventHandler - The event handler that should be notified of authentication
events. Can be null (in which case no events are sent). If not
null, it will be registered with a new HostProtocolHandler
object before starting the authentication protocol so that it
is guaranteed that all events are posted to the event handler.keepSocketConnected - When set to true, the socket created in this method is not
closed but passed to the authentation success event for
further reuse.optionalParameter - If not null, this string will be passed to the server in the
authentication request message. Both the server and the client
will then subsequently forward this string in their
authentication success message. This parameter must be
encoded in 7-bit ASCII and must not contain spaces.useJSSE - If set to true, the JSSE API with the default JCE provider of the JVM will be used
for cryptographic operations. If set to false, an internal copy of the Bouncycastle
Lightweight API classes will be used.
java.net.UnknownHostException
java.io.IOException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||