|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.novell.nds.dirxml.driver.ssl.SSLFactory
public abstract class SSLFactory
Abstract class describing a factory that will produce SSL-capable sockets. This typically must be extended to allow specification of authentication parameters.
The getInstance()
method is used to get an implementation of this class.
This exists primarily to allow use to use various SSL providers that are accessed via introspection. This allows us to not require that a. the classes be present even when not used, and b. to use Java 2 classes without impacting the requirement that DirXML run under Java 1.1.7B on Netware 5.
Field Summary | |
---|---|
protected static int |
DEFAULT
Used with useClientMode and needClientAuth |
protected static int |
FALSE
Used with useClientMode and needClientAuth |
protected int |
needClientAuth
Specifies if sockets performing server handshake need to authenticate the other side. |
protected static int |
TRUE
Used with useClientMode and needClientAuth |
protected int |
useClientMode
Specifies handshake mode for sockets created by this factory. |
Constructor Summary | |
---|---|
SSLFactory()
|
Method Summary | |
---|---|
abstract ServerSocket |
createServerSocket(int port)
Returns a server socket which uses all network interfaces on the host, and is bound to the specified port. |
abstract ServerSocket |
createServerSocket(int port,
int backlog)
Returns a server socket which uses all network interfaces on the host, is bound to a the specified port, and uses the specified connection backlog. |
abstract ServerSocket |
createServerSocket(int port,
int backlog,
InetAddress ifAddress)
Returns a server socket which uses only the specified network interface on the local host, is bound to a the specified port, and uses the specified connection backlog. |
abstract Socket |
createSocket(InetAddress host,
int port)
Returns a socket connected to a ServerSocket at the specified network address and port. |
abstract Socket |
createSocket(InetAddress host,
int port,
InetAddress clientAddress,
int clientPort)
Returns a socket connected to a ServerSocket at the specified network address and port. |
abstract Socket |
createSocket(String host,
int port)
Returns a socket connected to a ServerSocket at the specified network address and port. |
abstract Socket |
createSocket(String host,
int port,
InetAddress clientAddress,
int clientPort)
Returns a socket connected to a ServerSocket at the specified network address and port. |
static SSLFactory |
getInstance(String type)
Return an instance of SSLFactory based on the passed type String . |
abstract String |
getSSLDescription(Socket socket)
Returns a String describing basic SSL connections parameters where available. |
abstract String |
getSSLVerboseDescription(Socket socket)
Returns a String describing verbose SSL connections parameters where available. |
void |
setNeedClientAuth(boolean needClientAuth)
Specify if a socket performing the server mode handshake will require the client to authenticate. |
void |
setUseClientMode(boolean useClientMode)
Specify whether to use client or server mode for the initial SSL handshake. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected int useClientMode
DEFAULT
, TRUE
, or FALSE
.
protected int needClientAuth
DEFAULT
, TRUE
, or FALSE
.
protected static final int FALSE
useClientMode
and needClientAuth
protected static final int TRUE
useClientMode
and needClientAuth
protected static final int DEFAULT
useClientMode
and needClientAuth
Constructor Detail |
---|
public SSLFactory()
Method Detail |
---|
public static SSLFactory getInstance(String type) throws IllegalArgumentException, SSLInitializationException
String
.
Valid values for type
are:
"kmo" - returns a factory that implements KmoSSLFactory
and returns
sockets that use Novell's SAS SSL implementation. Certificates and keys
are used from eDirectory Key Material Objects.
"keystore" - returns a factory that implements KeyStoreSSLFactory
and
returns sockets that use Sun's JSSE SSL implementation. Certificates and
keys are used from a Java KeyStore object, stored as a file.
type
- "kmo" or "keystore"
IllegalArgumentException
- if type
value is invalid.
SSLInitializationException
- thrown if an error occurs creating the factorypublic void setUseClientMode(boolean useClientMode)
useClientMode
- true
if sockets from this factory should use
client mode handshakes.public void setNeedClientAuth(boolean needClientAuth)
needClientAuth
- true
if client authentication is to be required.public abstract ServerSocket createServerSocket(int port) throws IOException
port
- the port to listen to
IOException
- for networking errorspublic abstract ServerSocket createServerSocket(int port, int backlog) throws IOException
port
- the port to listen tobacklog
- how many connections are queued
IOException
- for networking errorspublic abstract ServerSocket createServerSocket(int port, int backlog, InetAddress ifAddress) throws IOException
port
- the port to listen tobacklog
- how many connections are queuedifAddress
- the network interface address to use
IOException
- for networking errorspublic abstract Socket createSocket(InetAddress host, int port) throws IOException
host
- the server hostport
- the server port
IOException
- if the connection can't be establishedpublic abstract Socket createSocket(InetAddress host, int port, InetAddress clientAddress, int clientPort) throws IOException
host
- the server hostport
- the server portclientAddress
- the client network interface addressclientPort
- the client port
IOException
- if the connection can't be establishedpublic abstract Socket createSocket(String host, int port) throws IOException, UnknownHostException
host
- the server hostport
- the server port
IOException
- if the connection can't be established
UnknownHostException
- if the host name can't be resolvedpublic abstract Socket createSocket(String host, int port, InetAddress clientAddress, int clientPort) throws IOException, UnknownHostException
host
- the server hostport
- the server portclientAddress
- the client network interface addressclientPort
- the client port
IOException
- if the connection can't be established
UnknownHostException
- if the host name can't be resolvedpublic abstract String getSSLDescription(Socket socket) throws ClassCastException
socket
- a Socket returned by this SSLFactory instance's createSocket(),
or by ServerSocket.accept() where the ServerSocket was returned by this SSLFactory
instance's createServerSocket().
ClassCastException
- thrown if the passed Socket is not of a type supported
by this SSLFactory.public abstract String getSSLVerboseDescription(Socket socket) throws ClassCastException
socket
- a Socket returned by this SSLFactory instance's createSocket(),
or by ServerSocket.accept() where the ServerSocket was returned by this SSLFactory
instance's createServerSocket().
ClassCastException
- thrown if the passed Socket is not of a type supported
by this SSLFactory.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |