|
From: <kc...@us...> - 2003-08-04 02:26:51
|
Update of /cvsroot/ebxmlms/ebxmlms/src/hk/hku/cecid/phoenix/pki
In directory sc8-pr-cvs1:/tmp/cvs-serv1748/src/hk/hku/cecid/phoenix/pki
Modified Files:
Tag: b0931
CompositeKeyStore.java
Log Message:
use bouncycastle to handle pkcs12 keystore instead of jsse (jsse is buggy)
Index: CompositeKeyStore.java
===================================================================
RCS file: /cvsroot/ebxmlms/ebxmlms/src/hk/hku/cecid/phoenix/pki/CompositeKeyStore.java,v
retrieving revision 1.3.2.1
retrieving revision 1.3.2.2
diff -C2 -d -r1.3.2.1 -r1.3.2.2
*** CompositeKeyStore.java 9 Apr 2003 08:41:44 -0000 1.3.2.1
--- CompositeKeyStore.java 4 Aug 2003 02:26:48 -0000 1.3.2.2
***************
*** 231,234 ****
--- 231,235 ----
}
else if (ksp.getType().toUpperCase().equals("PKCS12")) {
+ /*
if (isUsingJSSE()) {
try {
***************
*** 259,262 ****
--- 260,286 ----
catch (KeyStoreException e) {}
}
+ */
+
+ try {
+ Class clsProv = Class.forName(
+ "org.bouncycastle.jce.provider.BouncyCastleProvider");
+ Constructor c = clsProv.getConstructor(null);
+ Provider provider = (Provider) c.newInstance(null);
+ if (Security.getProvider(provider.getName()) == null) {
+ Security.addProvider(provider);
+ }
+ }
+ catch (ClassNotFoundException e) {}
+ catch (NoSuchMethodException e) {}
+ catch (InstantiationException e) {}
+ catch (IllegalAccessException e) {}
+ catch (InvocationTargetException e) {}
+
+ try {
+ ks = KeyStore.getInstance("PKCS12", "BC");
+ }
+ catch (NoSuchProviderException e) {}
+ catch (KeyStoreException e) {}
+
}
if (ks != null) {
|