Index: TLSServerSocketFactory.java
===================================================================
RCS file: /home/cvspublic/jakarta-avalon-cornerstone/src/java/org/apache/avalon/cornerstone/blocks/sockets/TLSServerSocketFactory.java,v
retrieving revision 1.7
diff -u -r1.7 TLSServerSocketFactory.java
--- TLSServerSocketFactory.java	16 Mar 2002 00:18:34 -0000	1.7
+++ TLSServerSocketFactory.java	3 Jun 2002 20:46:37 -0000
@@ -39,6 +39,7 @@
  * @author <a href="mailto:">Harish Prabandham</a>
  * @author <a href="mailto:">Costin Manolache</a>
  * @author <a href="mailto:">Craig McClanahan</a>
+ * @author <a href="mailto:myfam@surfeu.fi">Andrei Ivanov</a> 
  */
 public class TLSServerSocketFactory
     extends AbstractLogEnabled
@@ -49,6 +50,7 @@
 
     protected String m_keyStoreFile;
     protected String m_keyStorePassword;
+    protected String m_keyPassword;      
     protected String m_keyStoreType;
     protected String m_keyStoreProtocol;
     protected String m_keyStoreAlgorithm;
@@ -66,6 +68,7 @@
      * <keystore>
      *  <file>conf/keystore</file> <!-- location of keystore relative to .sar base directory -->
      *  <password></password> <!-- Password for the Key Store file -->
+     *  <key-password></key-password> <!-- Optional private Key Password -->
      *  <type>JKS</type> <!-- Type of the Key Store file -->
      *  <protocol>TLS</protocol> <!-- SSL protocol to use -->
      *  <algorithm>SunX509</algorithm> <!-- Certificate encoding algorithm -->
@@ -81,6 +84,7 @@
         final Configuration keyStore = configuration.getChild( "keystore" );
         m_keyStoreFile = keyStore.getChild( "file" ).getValue( "conf/keystore" );
         m_keyStorePassword = keyStore.getChild( "password" ).getValue();
+        m_keyPassword = keyStore.getChild( "key-password" ).getValue(null);            
         m_keyStoreType = keyStore.getChild( "type" ).getValue( "JKS" );
         m_keyStoreProtocol = keyStore.getChild( "protocol" ).getValue( "TLS" );
         m_keyStoreAlgorithm = keyStore.getChild( "algorithm" ).getValue( "SunX509" );
@@ -128,7 +132,14 @@
         final KeyManagerFactory keyManagerFactory =
             KeyManagerFactory.getInstance( m_keyStoreAlgorithm );
 
-        keyManagerFactory.init( keyStore, m_keyStorePassword.toCharArray() );
+        if ( null == m_keyPassword ) 
+        {
+          keyManagerFactory.init( keyStore, m_keyStorePassword.toCharArray() );
+        } else 
+        {
+          keyManagerFactory.init( keyStore, m_keyPassword.toCharArray() );
+        }
+        
 
         final TrustManagerFactory tmf = TrustManagerFactory.getInstance( m_keyStoreAlgorithm );
         tmf.init( keyStore );

