Package org.jpos.iso
Class GenericSSLSocketFactory
- java.lang.Object
-
- org.jpos.util.SimpleLogSource
-
- org.jpos.iso.GenericSSLSocketFactory
-
- All Implemented Interfaces:
Configurable
,ISOClientSocketFactory
,ISOServerSocketFactory
,LogSource
- Direct Known Subclasses:
SunJSSESocketFactory
public class GenericSSLSocketFactory extends SimpleLogSource implements ISOServerSocketFactory, ISOClientSocketFactory, Configurable
SunJSSESocketFactory
is used by BaseChannel and ISOServer in order to provide hooks for SSL implementations.- Since:
- 1.3.3
-
-
Field Summary
-
Fields inherited from class org.jpos.util.SimpleLogSource
logger, realm
-
-
Constructor Summary
Constructors Constructor Description GenericSSLSocketFactory()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.net.ServerSocket
createServerSocket(int port)
Create a server socket on the specified port (port 0 indicates an anonymous port).protected javax.net.ssl.SSLServerSocketFactory
createServerSocketFactory()
Create a socket factoryjava.net.Socket
createSocket(java.lang.String host, int port)
Create a client socket connected to the specified host and port.protected javax.net.ssl.SSLSocketFactory
createSocketFactory()
Create a socket factoryboolean
getClientAuthNeeded()
Configuration
getConfiguration()
java.lang.String[]
getEnabledCipherSuites()
protected java.lang.String
getKeyPassword()
java.lang.String
getKeyStore()
protected java.lang.String
getPassword()
boolean
getServerAuthNeeded()
java.lang.String
getServerName()
void
setClientAuthNeeded(boolean clientAuthNeeded)
void
setConfiguration(Configuration cfg)
void
setEnabledCipherSuites(java.lang.String[] enabledCipherSuites)
void
setKeyPassword(java.lang.String keyPassword)
void
setKeyStore(java.lang.String keyStore)
void
setPassword(java.lang.String password)
void
setServerAuthNeeded(boolean serverAuthNeeded)
void
setServerName(java.lang.String serverName)
-
-
-
Constructor Detail
-
GenericSSLSocketFactory
public GenericSSLSocketFactory()
-
-
Method Detail
-
setKeyStore
public void setKeyStore(java.lang.String keyStore)
-
setPassword
public void setPassword(java.lang.String password)
-
setKeyPassword
public void setKeyPassword(java.lang.String keyPassword)
-
setServerName
public void setServerName(java.lang.String serverName)
-
setClientAuthNeeded
public void setClientAuthNeeded(boolean clientAuthNeeded)
-
setServerAuthNeeded
public void setServerAuthNeeded(boolean serverAuthNeeded)
-
createServerSocketFactory
protected javax.net.ssl.SSLServerSocketFactory createServerSocketFactory() throws ISOException
Create a socket factory- Returns:
- the socket factory
- Throws:
ISOException
- if an error occurs during server socket creation
-
createSocketFactory
protected javax.net.ssl.SSLSocketFactory createSocketFactory() throws ISOException
Create a socket factory- Returns:
- the socket factory
- Throws:
ISOException
- if an error occurs during server socket creation
-
createServerSocket
public java.net.ServerSocket createServerSocket(int port) throws java.io.IOException, ISOException
Create a server socket on the specified port (port 0 indicates an anonymous port).- Specified by:
createServerSocket
in interfaceISOServerSocketFactory
- Parameters:
port
- the port number- Returns:
- the server socket on the specified port
- Throws:
java.io.IOException
- should an I/O error occurs duringISOException
- should an error occurs during creation
-
createSocket
public java.net.Socket createSocket(java.lang.String host, int port) throws java.io.IOException, ISOException
Create a client socket connected to the specified host and port.- Specified by:
createSocket
in interfaceISOClientSocketFactory
- Parameters:
host
- the host nameport
- the port number- Returns:
- a socket connected to the specified host and port.
- Throws:
java.io.IOException
- if an I/O error occurs during socket creationISOException
- should any other error occurs
-
getKeyStore
public java.lang.String getKeyStore()
-
getPassword
protected java.lang.String getPassword()
-
getKeyPassword
protected java.lang.String getKeyPassword()
-
getServerName
public java.lang.String getServerName()
-
getClientAuthNeeded
public boolean getClientAuthNeeded()
-
getServerAuthNeeded
public boolean getServerAuthNeeded()
-
setEnabledCipherSuites
public void setEnabledCipherSuites(java.lang.String[] enabledCipherSuites)
-
getEnabledCipherSuites
public java.lang.String[] getEnabledCipherSuites()
-
setConfiguration
public void setConfiguration(Configuration cfg) throws ConfigurationException
- Specified by:
setConfiguration
in interfaceConfigurable
- Parameters:
cfg
- Configuration object- Throws:
ConfigurationException
-
getConfiguration
public Configuration getConfiguration()
-
-