geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vamsic...@apache.org
Subject svn commit: r477205 - /geronimo/server/trunk/modules/geronimo-security/src/main/java/org/apache/geronimo/security/keystore/FileKeystoreInstance.java
Date Mon, 20 Nov 2006 14:42:12 GMT
Author: vamsic007
Date: Mon Nov 20 06:42:12 2006
New Revision: 477205

URL: http://svn.apache.org/viewvc?view=rev&rev=477205
Log:
GERONIMO-2586  KeystorePortlet: Unlock keystore for availability shows key aliases only when
keystore is unlocked for edit
o Required for unlock to be successful

Modified:
    geronimo/server/trunk/modules/geronimo-security/src/main/java/org/apache/geronimo/security/keystore/FileKeystoreInstance.java

Modified: geronimo/server/trunk/modules/geronimo-security/src/main/java/org/apache/geronimo/security/keystore/FileKeystoreInstance.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-security/src/main/java/org/apache/geronimo/security/keystore/FileKeystoreInstance.java?view=diff&rev=477205&r1=477204&r2=477205
==============================================================================
--- geronimo/server/trunk/modules/geronimo-security/src/main/java/org/apache/geronimo/security/keystore/FileKeystoreInstance.java
(original)
+++ geronimo/server/trunk/modules/geronimo-security/src/main/java/org/apache/geronimo/security/keystore/FileKeystoreInstance.java
Mon Nov 20 06:42:12 2006
@@ -201,10 +201,13 @@
     }
 
     public void unlockPrivateKey(String alias, char[] storePassword, char[] password) throws
KeystoreException {
-        if (storePassword == null) {
-            throw new NullPointerException("storePassword is null");
+        if (storePassword == null && keystorePassword == null) {
+            throw new KeystoreException("storePassword is null and keystore is locked for
availability.");
         }
-        getPrivateKey(alias, storePassword, password);
+        if(storePassword != null)
+            getPrivateKey(alias, storePassword, password);
+        else
+            getPrivateKey(alias, keystorePassword, password);
         keyPasswords.put(alias, password);
         storePasswords();
     }



Mime
View raw message