org.mozilla.jss.tests

Class JSS_SelfServClient

public class JSS_SelfServClient extends Object implements ConstantsBase, Constants

Nested Class Summary
classJSS_SelfServClient.HandshakeListener
SSL Handshake Listeren implementation.
Constructor Summary
JSS_SelfServClient()
Default Constructor.
Method Summary
voidclearHandshakeCompleted()
Clear handshakeCompleted flag to indicate that the system is now ready for another socket connection.
voidcloseAllSockets()
closes the SSLSocket
voidconfigureCipherSuites(String server)
voidconfigureDefaultSSLOptions()
voidcreateSSLConnections(int numToCreate)
Initialize given number of SSLSocket client connection to the SSLServer using the set parameters.
booleangetBypassPKCS11()
intgetSockTotal()
returns the total number SSLSockets created.
booleangetSuccess()
Set status return value to success.
booleangetTestCiphers()
booleanisHandshakeCompleted()
Return true if handshake is completed else return false;
booleanisServerAlive()
static voidmain(String[] args)
Main method.
voidoutputCipherResults()
voidsendServerShutdownMsg()
sendServerShutdownMsg
voidsetBypassPKCS11(boolean f)
voidsetCertDbPath(String aCertDbPath)
Initialize the cert db path name
voidsetCipher(int aCipher)
Initialize the desired ciphersuite to be set on the socket.
voidsetClientCertNick(String aClientCertNick)
Set client certificate
voidsetFailure()
Set status return value to false.
voidsetHandshakeCompleted()
Set handshakeCompleted flag to indicate that the socket handshake is coplete.
voidsetHostName(String aHostName)
Initialize the hostname to run the server
voidsetPasswordFile(String aPasswordFile)
Initialize the passwords file name
voidsetPort(int aPort)
Initialize the port to run the server
voidsetTestCertCallback(boolean aTestCertCallback)
Enable/disable Test Cert Callback.
voidsetTestCiphers(boolean t)
voidsetVerbose(boolean v)
voidtestCiphersuites(int numOfThreads)
For every enabled ciphersuite created numOfThreads connections.
booleantestJSSCiphersMatchNSS()
returns true if JSS is sync with NSS ciphersuites.

Constructor Detail

JSS_SelfServClient

public JSS_SelfServClient()
Default Constructor.

Method Detail

clearHandshakeCompleted

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

closeAllSockets

public void closeAllSockets()
closes the SSLSocket

configureCipherSuites

public void configureCipherSuites(String server)

configureDefaultSSLOptions

public void configureDefaultSSLOptions()

createSSLConnections

public void createSSLConnections(int numToCreate)
Initialize given number of SSLSocket client connection to the SSLServer using the set parameters. Each Connection will have a separate thread performing I/O to the Server.

getBypassPKCS11

public boolean getBypassPKCS11()

getSockTotal

public int getSockTotal()
returns the total number SSLSockets created.

getSuccess

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

getTestCiphers

public boolean getTestCiphers()

isHandshakeCompleted

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

Returns: boolean handshake status

isServerAlive

public boolean isServerAlive()

main

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

outputCipherResults

public void outputCipherResults()

sendServerShutdownMsg

public void sendServerShutdownMsg()
sendServerShutdownMsg

setBypassPKCS11

public void setBypassPKCS11(boolean f)

setCertDbPath

public void setCertDbPath(String aCertDbPath)
Initialize the cert db path name

Parameters: String CertDbPath

setCipher

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

Parameters: int Cipher

setClientCertNick

public void setClientCertNick(String aClientCertNick)
Set client certificate

Parameters: String Certificate Nick Name

setFailure

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

setHandshakeCompleted

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

setHostName

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

Parameters: String ServerName

setPasswordFile

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

Parameters: String passwords

setPort

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

Parameters: int port

setTestCertCallback

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

Parameters: boolean

setTestCiphers

public void setTestCiphers(boolean t)

setVerbose

public void setVerbose(boolean v)

testCiphersuites

public void testCiphersuites(int numOfThreads)
For every enabled ciphersuite created numOfThreads connections.

testJSSCiphersMatchNSS

public boolean testJSSCiphersMatchNSS()
returns true if JSS is sync with NSS ciphersuites.