You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by jo...@apache.org on 2007/04/27 01:30:46 UTC
svn commit: r532907 -
/ofbiz/branches/release4.0/framework/base/src/base/org/ofbiz/base/util/KeyStoreUtil.java
Author: jonesde
Date: Thu Apr 26 16:30:45 2007
New Revision: 532907
URL: http://svn.apache.org/viewvc?view=rev&rev=532907
Log:
Applied fix from trunk in rev 532595, note that this includes a manually corrected conflict in the merge
Modified:
ofbiz/branches/release4.0/framework/base/src/base/org/ofbiz/base/util/KeyStoreUtil.java
Modified: ofbiz/branches/release4.0/framework/base/src/base/org/ofbiz/base/util/KeyStoreUtil.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/release4.0/framework/base/src/base/org/ofbiz/base/util/KeyStoreUtil.java?view=diff&rev=532907&r1=532906&r2=532907
==============================================================================
--- ofbiz/branches/release4.0/framework/base/src/base/org/ofbiz/base/util/KeyStoreUtil.java (original)
+++ ofbiz/branches/release4.0/framework/base/src/base/org/ofbiz/base/util/KeyStoreUtil.java Thu Apr 26 16:30:45 2007
@@ -31,6 +31,8 @@
import java.security.spec.PKCS8EncodedKeySpec;
import java.util.Collection;
import java.util.Map;
+import java.util.regex.Pattern;
+import java.util.regex.Matcher;
import javolution.util.FastMap;
@@ -53,7 +55,7 @@
public static KeyStore getComponentKeyStore(String componentName, String keyStoreName) throws IOException, GeneralSecurityException, GenericConfigException {
ComponentConfig.KeystoreInfo ks = ComponentConfig.getKeystoreInfo(componentName, keyStoreName);
- return getStore(ks.createResourceHandler().getURL(), ks.getType(), ks.getPassword());
+ return getStore(ks.createResourceHandler().getURL(), ks.getPassword(), ks.getType());
}
public static KeyStore getStore(URL url, String password) throws IOException, GeneralSecurityException {
@@ -92,11 +94,14 @@
public static Map getCertX500Map(X509Certificate cert) {
X500Principal x500 = cert.getSubjectX500Principal();
Map x500Map = FastMap.newInstance();
-
- String[] x500Opts = x500.getName().split("\\,");
+
+ String name = x500.getName().replaceAll("\\\\,", "&com;");
+ String[] x500Opts = name.split("\\,");
for (int x = 0; x < x500Opts.length; x++) {
- String[] nv = x500Opts[x].split("\\=");
- x500Map.put(nv[0], nv[1]);
+ if (x500Opts[x].indexOf("=") > -1) {
+ String[] nv = x500Opts[x].split("\\=", 2);
+ x500Map.put(nv[0].replaceAll("&com;", ","), nv[1].replaceAll("&com;", ","));
+ }
}
return x500Map;