org.openuat.apps
Class IPSecConnectorAdmin

java.lang.Object
  extended by org.openuat.apps.IPSecConnectorCommon
      extended by org.openuat.apps.IPSecConnectorAdmin
All Implemented Interfaces:
AuthenticationProgressHandler

public class IPSecConnectorAdmin
extends IPSecConnectorCommon

Version:
1.0
Author:
Rene Mayrhofer

Field Summary
 
Fields inherited from class org.openuat.apps.IPSecConnectorCommon
adminEnd, auth, authenticationProgress, BLOCKNAME_CERTIFICATE, BLOCKNAME_CONFIG, display, manager
 
Constructor Summary
IPSecConnectorAdmin(uk.ac.lancs.relate.core.Configuration relateConf, java.lang.String caFile, java.lang.String caPassword, java.lang.String caAlias, java.lang.String configFilename, org.eclipse.swt.widgets.Display display)
           
 
Method Summary
protected  boolean asyncCreateCertificate(java.lang.String commonName, int validityDays, java.lang.String exportPassword)
          This method encapsulates the creation of a X.509 certificate in a background thread.
 void AuthenticationSuccess(java.lang.Object sender, java.lang.Object remote, java.lang.Object result)
          Upon successful authentication, the established shared key can be used with the remote host.
 void issueCertificate()
           
static void main(java.lang.String[] args)
           
 
Methods inherited from class org.openuat.apps.IPSecConnectorCommon
AuthenticationFailure, AuthenticationProgress
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IPSecConnectorAdmin

public IPSecConnectorAdmin(uk.ac.lancs.relate.core.Configuration relateConf,
                           java.lang.String caFile,
                           java.lang.String caPassword,
                           java.lang.String caAlias,
                           java.lang.String configFilename,
                           org.eclipse.swt.widgets.Display display)
                    throws uk.ac.lancs.relate.core.DeviceException,
                           ConfigurationErrorException,
                           InternalApplicationException,
                           java.io.IOException
Throws:
uk.ac.lancs.relate.core.DeviceException
ConfigurationErrorException
InternalApplicationException
java.io.IOException
Method Detail

main

public static void main(java.lang.String[] args)
                 throws uk.ac.lancs.relate.core.DeviceException,
                        ConfigurationErrorException,
                        InternalApplicationException,
                        java.io.IOException
Parameters:
args -
Throws:
java.io.IOException
InternalApplicationException
ConfigurationErrorException
DongleException
uk.ac.lancs.relate.core.DeviceException

asyncCreateCertificate

protected boolean asyncCreateCertificate(java.lang.String commonName,
                                         int validityDays,
                                         java.lang.String exportPassword)
This method encapsulates the creation of a X.509 certificate in a background thread. It will fire off a thread, which will then post its result to the certificateFilename member. If the certificate generation failed after starting the background thread, the certificateFilename member will contain the string "ERROR", optionally followed by an exception converted to a string that caused the abort. On success, the certificateFilename member will contain the name of a temporary file with the newly created certificate. In both cases, certificateFilename.notify() will be called after modifying it, so that other threads can wait for it to be modified.

Parameters:
commonName - The common name to use for the DN field of the certificate.
validityDays - The number of days this certificate should be valid.
exportPassword - The password to export the certificate and the matching private key with.
Returns:
true if the thread was started successfully, false otherwise.
See Also:
certificateFilename

AuthenticationSuccess

public void AuthenticationSuccess(java.lang.Object sender,
                                  java.lang.Object remote,
                                  java.lang.Object result)
Description copied from interface: AuthenticationProgressHandler
Upon successful authentication, the established shared key can be used with the remote host. The type of the remoteHost object depends on the sender of the event, e.g. an InetAddress object for HostProtocolHandler generated events, but an Integer for DongleProtocolHandler generated events (encapsulating the remote relate id).

Parameters:
sender - The object which sent this event.
remote - The remote end with which the authentication is performed. Depends on the sender of the event.
result - The result, if any, of the successful authentication. This can e.g. be a shared key or a set of keys or can even be null if the authentication event is enough to signal successful authentication.

issueCertificate

public void issueCertificate()


2005-2006, Rene Mayrhofer.