You are currently viewing a snapshot of www.mozilla.org taken on April 21, 2008. Most of this content is highly out of date (some pages haven't been updated since the project began in 1998) and exists for historical purposes only. If there are any pages on this archive site that you think should be added back to www.mozilla.org, please file a bug.




org.mozilla.jss.tests
Class JSS_SSLClient

java.lang.Object
  extended by org.mozilla.jss.tests.JSS_SSLClient

public class JSS_SSLClient
extends java.lang.Object

JSS_SSLClient class enables a cipher or all supported JSS ciphers and tries to communicate with a SSL server. This can be used to test interoperability with other SSL implementations such as JSSE, OpenSSL. The result is a listing of common ciphers between the server and this JSS client.


Nested Class Summary
 class JSS_SSLClient.HandshakeListener
          SSL Handshake Listeren implementation.
 
Constructor Summary
JSS_SSLClient()
          Default Constructor, do not use.
 
Method Summary
 void clearHandshakeCompleted()
          Clear handshakeCompleted flag to indicate that the system is now ready for another socket connection.
 void doIt()
          Initialize and create a socket connection to SSLServer using the set parameters.
static java.lang.String getCertDbPath()
          Fetch the cert db path name
 boolean getSuccess()
          Set status return value to success.
 boolean isHandshakeCompleted()
          Return true if handshake is completed else return false;
static void main(java.lang.String[] args)
          Main method.
 void setBypass(boolean bypass)
          Enable/disable Test Cert Callback.
static void setCertDbPath(java.lang.String aCertDbPath)
          Initialize the cert db path name
 void setCipher(int aCipher)
          Initialize the desired cipher to be set on the socket.
 void setClientCertNick(java.lang.String aClientCertNick)
          Set client certificate
 void setEOF(java.lang.String fEof)
          Set EOF for closinng server socket
 void setFailure()
          Set status return value to false.
 void setHandshakeCompleted()
          Set handshakeCompleted flag to indicate that the socket handshake is coplete.
 void setHostName(java.lang.String aHostName)
          Initialize the hostname to run the server
 void setPasswordFile(java.lang.String aPasswordFile)
          Initialize the passwords file name
 void setPort(int aPort)
          Initialize the port to run the server
 void setTestCertCallback(boolean aTestCertCallback)
          Enable/disable Test Cert Callback.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JSS_SSLClient

public JSS_SSLClient()
Default Constructor, do not use.

Method Detail

setCipher

public void setCipher(int aCipher)
Initialize the desired cipher to be set on the socket.

Parameters:
int - Cipher

setHostName

public void setHostName(java.lang.String aHostName)
Initialize the hostname to run the server

Parameters:
String - ServerName

setPort

public void setPort(int aPort)
Initialize the port to run the server

Parameters:
int - port

setPasswordFile

public void setPasswordFile(java.lang.String aPasswordFile)
Initialize the passwords file name

Parameters:
String - passwords

setCertDbPath

public static void setCertDbPath(java.lang.String aCertDbPath)
Initialize the cert db path name

Parameters:
String - CertDbPath

getCertDbPath

public static java.lang.String getCertDbPath()
Fetch the cert db path name

Returns:
String CertDbPath

setBypass

public void setBypass(boolean bypass)
Enable/disable Test Cert Callback.

Parameters:
boolean -

setTestCertCallback

public void setTestCertCallback(boolean aTestCertCallback)
Enable/disable Test Cert Callback.

Parameters:
boolean -

setClientCertNick

public void setClientCertNick(java.lang.String aClientCertNick)
Set client certificate

Parameters:
String - Certificate Nick Name

isHandshakeCompleted

public boolean isHandshakeCompleted()
Return true if handshake is completed else return false;

Returns:
boolean handshake status

setHandshakeCompleted

public void setHandshakeCompleted()
Set handshakeCompleted flag to indicate that the socket handshake is coplete.


clearHandshakeCompleted

public void clearHandshakeCompleted()
Clear handshakeCompleted flag to indicate that the system is now ready for another socket connection.


setEOF

public void setEOF(java.lang.String fEof)
Set EOF for closinng server socket

Parameters:
null - for closing server socket

doIt

public void doIt()
          throws java.lang.Exception
Initialize and create a socket connection to SSLServer using the set parameters.

Throws:
java.lang.Exception

setFailure

public void setFailure()
Set status return value to false.


getSuccess

public boolean getSuccess()
Set status return value to success.


main

public static void main(java.lang.String[] args)
Main method. Used for unit testing.