Package netscape.ldap
Class LDAPSSLSocketFactory
- java.lang.Object
-
- netscape.ldap.LDAPSSLSocketFactory
-
- All Implemented Interfaces:
java.io.Serializable,LDAPSocketFactory,LDAPSSLSocketFactoryExt
public class LDAPSSLSocketFactory extends java.lang.Object implements LDAPSSLSocketFactoryExt, java.io.Serializable
Creates an SSL socket connection to an LDAP Server. This class implements theLDAPSSLSocketFactoryExtinterface.To construct an object of this class, you need to specify the name of a class that implements the
javax.net.ssl.SSLSocketinterface. If you do not specify a class name, the classnetscape.net.SSLSocketis used by default. This class is included with Netscape Communicator 4.05 and up.If you are using a Java VM that provides certificate database management (such as Netscape Communicator), you can authenticate your client to a secure LDAP server by using certificates.
- Version:
- 1.0
- See Also:
LDAPSSLSocketFactoryExt,LDAPConnection(netscape.ldap.LDAPSocketFactory), Serialized Form
-
-
Constructor Summary
Constructors Constructor Description LDAPSSLSocketFactory()Constructs anLDAPSSLSocketFactoryobject using the default SSL socket implementation,netscape.net.SSLSocket.LDAPSSLSocketFactory(boolean clientAuth)Constructs anLDAPSSLSocketFactoryobject using the default SSL socket implementation,netscape.net.SSLSocket.LDAPSSLSocketFactory(java.lang.String className)Constructs anLDAPSSLSocketFactoryobject using the specified class.LDAPSSLSocketFactory(java.lang.String className, boolean clientAuth)Constructs anLDAPSSLSocketFactoryobject using the specified class.LDAPSSLSocketFactory(java.lang.String className, java.lang.Object cipherSuites)The constructor with the specified package for security and the specified cipher suites.LDAPSSLSocketFactory(java.lang.String className, java.lang.Object cipherSuites, boolean clientAuth)The constructor with the specified package for security and the specified cipher suites.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidenableClientAuth()Enables certificate-based client authentication for an application.voidenableClientAuth(java.lang.String certdb, java.lang.String keydb, java.lang.String keypwd, java.lang.String certnickname, java.lang.String keynickname)This method is currently not implemented.java.lang.ObjectgetCipherSuites()Returns the suite of ciphers used for SSL connections made through sockets created by this factory.java.lang.StringgetSSLSocketImpl()Returns the name of the class that implements SSL sockets for this factory.booleanisClientAuth()Returnstrueif client authentication is enabled.java.net.SocketmakeSocket(java.lang.String host, int port)Returns a socket to the LDAP server with the specified host name and port number.
-
-
-
Constructor Detail
-
LDAPSSLSocketFactory
public LDAPSSLSocketFactory()
Constructs anLDAPSSLSocketFactoryobject using the default SSL socket implementation,netscape.net.SSLSocket. (This class is provided with Netscape Communicator 4.05 and higher.)
-
LDAPSSLSocketFactory
public LDAPSSLSocketFactory(boolean clientAuth)
Constructs anLDAPSSLSocketFactoryobject using the default SSL socket implementation,netscape.net.SSLSocket. (This class is provided with Netscape Communicator 4.05 and up.)- Parameters:
clientAuth-trueif certificate-based client authentication is desired. By default, client authentication is not used.
-
LDAPSSLSocketFactory
public LDAPSSLSocketFactory(java.lang.String className)
Constructs anLDAPSSLSocketFactoryobject using the specified class. The class must implement the interfacejavax.net.ssl.SSLSocket.- Parameters:
className- the name of a class implementing thejavax.net.ssl.SSLSocketinterface. Passnullfor this parameter to use the default SSL socket implementation,netscape.net.SSLSocket, which is included with Netscape Communicator 4.05 and higher.
-
LDAPSSLSocketFactory
public LDAPSSLSocketFactory(java.lang.String className, boolean clientAuth)Constructs anLDAPSSLSocketFactoryobject using the specified class. The class must implement the interfacejavax.net.ssl.SSLSocket.- Parameters:
className- the name of a class implementing thejavax.net.ssl.SSLSocketinterface. Passnullfor this parameter to use the default SSL socket implementation,netscape.net.SSLSocket, which is included with Netscape Communicator 4.05 and higher.clientAuth-trueif certificate-based client authentication is desired. By default, client authentication is not used.
-
LDAPSSLSocketFactory
public LDAPSSLSocketFactory(java.lang.String className, java.lang.Object cipherSuites)The constructor with the specified package for security and the specified cipher suites.- Parameters:
className- the name of a class implementing the interfacejavax.net.ssl.SSLSocket. Passnullfor this parameter to use the default SSL socket implementation,netscape.net.SSLSocket, which is included with Netscape Communicator 4.05 and higher.cipherSuites- the cipher suites to use for SSL connections
-
LDAPSSLSocketFactory
public LDAPSSLSocketFactory(java.lang.String className, java.lang.Object cipherSuites, boolean clientAuth)The constructor with the specified package for security and the specified cipher suites.- Parameters:
className- the name of a class implementing the interfacejavax.net.ssl.SSLSocket. Passnullfor this parameter to use the default SSL socket implementation,netscape.net.SSLSocket, which is included with Netscape Communicator 4.05 and higher.cipherSuites- the cipher suites to use for SSL connectionsclientAuth-trueif certificate-based client authentication is desired. By default, client authentication is not used.
-
-
Method Detail
-
enableClientAuth
public void enableClientAuth()
Enables certificate-based client authentication for an application. The application must be running in a Java VM that provides transparent certificate database management (for example, Netscape Communicator's Java VM). Call this method before you callmakeSocket.
-
enableClientAuth
public void enableClientAuth(java.lang.String certdb, java.lang.String keydb, java.lang.String keypwd, java.lang.String certnickname, java.lang.String keynickname) throws LDAPExceptionThis method is currently not implemented. Enables client authentication for an application that uses an external (file-based) certificate database. Call this method before you callmakeSocket.- Parameters:
certdb- the pathname for the certificate databasekeydb- the pathname for the private key databasekeypwd- the password for the private key databasecertnickname- the alias for the certificatekeynickname- the alias for the key- Throws:
LDAPException- Since this method is not yet implemented, calling this method throws an exception. Note:enableClientAuth(java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String)is deprecated. This method is replaced by any one of the following constructors:LDAPSSLSocketFactory(boolean)LDAPSSLSocketFactory(java.lang.String, boolean)LDAPSSLSocketFactory(java.lang.String, java.lang.Object, boolean)- See Also:
isClientAuth(),makeSocket(java.lang.String, int)
-
isClientAuth
public boolean isClientAuth()
Returnstrueif client authentication is enabled.- Specified by:
isClientAuthin interfaceLDAPSSLSocketFactoryExt- See Also:
LDAPSSLSocketFactory
-
getSSLSocketImpl
public java.lang.String getSSLSocketImpl()
Returns the name of the class that implements SSL sockets for this factory.- Returns:
- the name of the class that implements SSL sockets for this factory.
-
getCipherSuites
public java.lang.Object getCipherSuites()
Returns the suite of ciphers used for SSL connections made through sockets created by this factory.- Specified by:
getCipherSuitesin interfaceLDAPSSLSocketFactoryExt- Returns:
- the suite of ciphers used.
-
makeSocket
public java.net.Socket makeSocket(java.lang.String host, int port) throws LDAPExceptionReturns a socket to the LDAP server with the specified host name and port number.- Specified by:
makeSocketin interfaceLDAPSocketFactory- Parameters:
host- the host to connect toport- the port number- Returns:
- the socket to the host name and port number.
- Throws:
LDAPException- A socket to the specified host and port could not be created.- See Also:
LDAPSSLSocketFactory
-
-