From 2580cbbceb5638dfc03a706c364dfb8f11673fc7 Mon Sep 17 00:00:00 2001 From: "miodrag%netscape.com" Date: Wed, 4 Dec 2002 01:35:57 +0000 Subject: [PATCH] Removed unnecessary code, updated javadoc --- .../ldap/factory/JSSSocketFactory.java | 115 ++---------------- 1 file changed, 11 insertions(+), 104 deletions(-) diff --git a/directory/java-sdk/ldapjdk/netscape/ldap/factory/JSSSocketFactory.java b/directory/java-sdk/ldapjdk/netscape/ldap/factory/JSSSocketFactory.java index ab7c9e7cd3af..7eb05d37cee2 100644 --- a/directory/java-sdk/ldapjdk/netscape/ldap/factory/JSSSocketFactory.java +++ b/directory/java-sdk/ldapjdk/netscape/ldap/factory/JSSSocketFactory.java @@ -39,20 +39,10 @@ import org.mozilla.jss.CryptoManager; * This class implements the LDAPSocketFactory * interface. *

- * NOTE: This class is internal to Netscape and is distributed only with - * Netscape products. - *

- * By default, the factory uses "secmod.db", "key3.db" and "cert7.db" + * By default, the factory uses "secmod.db", "key*.db" and "cert*.db" * databases in the current directory. If you need to override this default - * setting, then you should call the static initialize method - * before creating the first instance of JSSSocketFactory. - *

- *

- *       ...
- *       JSSSocketFactory.initialize("../certDir");
- *       LDAPConnection ld = new LDAPConnection(new JSSSocketFactory());
- *       ...
- * 
+ * setting, then you should use the constructor JSSSocketFactory(certdbDir). + * * @version 1.1 * @see LDAPSocketFactory * @see LDAPConnection#LDAPConnection(netscape.ldap.LDAPSocketFactory) @@ -66,31 +56,11 @@ public class JSSSocketFactory implements Serializable, static final long serialVersionUID = -6926469178017736903L; /** - * Default security module database path "secmod.db". - */ - public static final String defaultModDB = "secmod.db"; - - /** - * Default key database path "key3.db". - */ - public static final String defaultKeyDB = "key3.db"; - - /** - * Default certificate database path "cert7.db". - */ - public static final String defaultCertDB = "cert7.db"; - - private static String moddb; - private static String keydb; - private static String certdb; - - - /** - * Constructs a new JSSSocketFactory. - * CryptoManager.initialize(certdbDir) or - * JSSSocketFactory.initialize(certdbDir) must be called once in the - * application before using the object. - * + * Constructs a new JSSSocketFactory, initializing the + * JSS security system if it has not already been initialized. + *

+ * The current directory is assumed to be the certificate database directory. + * * @exception LDAPException on initialization error * @see netscape.ldap.factory.JSSSocketFactory#JSSSocketFactory(java.lang.String) */ @@ -100,7 +70,7 @@ public class JSSSocketFactory implements Serializable, /** * Constructs a new JSSSocketFactory, initializing the - * JSS security system if it has not already been initialized + * JSS security system if it has not already been initialized. * * @param certdbDir The full path, relative or absolute, of the certificate * database directory @@ -115,8 +85,8 @@ public class JSSSocketFactory implements Serializable, *

* This method allows you to override the current directory as the * default certificate database directory. The directory is expected - * to contain secmod.db, key3.db and - * cert7.db files as the security module database, key database + * to contain secmod.db, key*.db and + * cert*.db files as the security module database, key database * and certificate database respectively. *

* The method may be called only once, before the first instance of @@ -130,9 +100,6 @@ public class JSSSocketFactory implements Serializable, * @see netscape.ldap.factory.JSSSocketFactory#JSSSocketFactory(String) */ public static void initialize( String certdbDir ) throws LDAPException { - moddb = certdbDir + File.separator + JSSSocketFactory.defaultModDB; - keydb = certdbDir + File.separator + JSSSocketFactory.defaultKeyDB; - certdb = certdbDir + File.separator + JSSSocketFactory.defaultCertDB; try { CryptoManager.initialize( certdbDir ); } catch (AlreadyInitializedException e) { @@ -143,66 +110,6 @@ public class JSSSocketFactory implements Serializable, } } - /** - * Initialize the JSS security subsystem. - *

- * This method allows you to override the default name and location of - * the security module database, key database and certificate databases. - *

- * The method may be called only once, before the first instance of - * JSSSocketFactory is created. When creating the first - * instance, the constructor will automatically initialize the JSS - * security subsystem using the defaults, unless it is already initialized. - *

- * @param moddb The full path, relative or absolute, of the security - * module database. - * @param keydb The full path, relative or absolute, of the key database. - * @param keydb The full path, relative or absolute, of the certificate - * database. - * @see netscape.ldap.factory.JSSSocketFactory#JSSSocketFactory - * @see netscape.ldap.factory.JSSSocketFactory#initialize(java.lang.String) - * @exception LDAPException on initialization error - * @deprecated Please call JSSSocketFactory(String certDir) instead - */ - public static void initialize( String moddb, String keydb, String certdb ) - throws LDAPException { - JSSSocketFactory.moddb = moddb; - JSSSocketFactory.keydb = keydb; - JSSSocketFactory.certdb = certdb; - int ind = certdb.lastIndexOf( File.separator ); - String certdbDir = ( ind == 0 ) ? File.separator : - ( ind > 0 ) ? certdb.substring( 0, ind ) : "."; - initialize( certdbDir ); - } - - /** - * Returns the full path of the security module - * database - * - * @return The full path, relative or absolute, of the security module database - */ - public static String getModDB() { - return moddb; - } - - /** - * Returns the full path of the key database - * - * @return The full path, relative or absolute, of the key database - */ - public static String getKeyDB() { - return keydb; - } - - /** - * Returns the full path of the certificate database - * - * @return The full path, relative or absolute, of the certificate database - */ - public static String getCertDB() { - return certdb; - } - /** * Creates an SSL socket *