Directory SDK
for Java 4.19

netscape.ldap.factory
Class JSSESocketFactory

java.lang.Object
  extended bynetscape.ldap.factory.JSSESocketFactory
All Implemented Interfaces:
LDAPSocketFactory, LDAPTLSSocketFactory, Serializable

public class JSSESocketFactory
extends Object
implements LDAPTLSSocketFactory, Serializable

Creates an SSL socket connection to a server, using the standard JSSE package. This class implements the LDAPSocketFactory interface.

See Also:
LDAPSocketFactory, LDAPConnection.LDAPConnection(netscape.ldap.LDAPSocketFactory), Serialized Form

Constructor Summary
JSSESocketFactory()
          Default factory constructor
JSSESocketFactory(String[] suites)
          Factory constructor that uses the default JSSE SSLSocketFactory
JSSESocketFactory(String[] suites, SSLSocketFactory factory)
          Factory constructor that provides an explicit SSLSocketFactory.
 
Method Summary
 Socket makeSocket(Socket s)
          Creates an SSL socket layered over an existing socket.
 Socket makeSocket(String host, int port)
          Creates an SSL socket.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JSSESocketFactory

public JSSESocketFactory()
Default factory constructor


JSSESocketFactory

public JSSESocketFactory(String[] suites)
Factory constructor that uses the default JSSE SSLSocketFactory

Parameters:
suites - Cipher suites to attempt to use with the server; if null, use any cipher suites available in the JSSE package

JSSESocketFactory

public JSSESocketFactory(String[] suites,
                         SSLSocketFactory factory)
Factory constructor that provides an explicit SSLSocketFactory.

Parameters:
suites - Cipher suites to attempt to use with the server; if null, use any cipher suites available in the JSSE package
factory - the specific SSL server socket factory to use
Method Detail

makeSocket

public Socket makeSocket(String host,
                         int port)
                  throws LDAPException
Creates an SSL socket.

Specified by:
makeSocket in interface LDAPSocketFactory
Parameters:
host - Host name or IP address of SSL server
port - Port numbers of SSL server
Returns:
A socket for an encrypted session
Throws:
LDAPException - on error creating socket
See Also:
LDAPSSLSocketFactory.makeSocket(java.lang.String,int)

makeSocket

public Socket makeSocket(Socket s)
                  throws LDAPException
Creates an SSL socket layered over an existing socket. Used for the startTLS implementation (RFC2830).

Specified by:
makeSocket in interface LDAPTLSSocketFactory
Parameters:
s - An existing non-SSL socket
Returns:
A SSL socket layered over the input socket
Throws:
LDAPException - on error creating socket
Since:
LDAPJDK 4.17
See Also:
LDAPConnection.startTLS()

Directory SDK
for Java 4.19

Java is a trademark or registered trademark of Sun Microsystems, Inc. in the US and other countries.
Copyright 2008 Sun Microsystems, Inc. All Rights Reserved.