cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dval...@apache.org
Subject svn commit: r1024070 - /cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/configuration/jsse/spring/TLSParameterJaxBUtils.java
Date Tue, 19 Oct 2010 00:28:54 GMT
Author: dvaleri
Date: Tue Oct 19 00:28:54 2010
New Revision: 1024070

URL: http://svn.apache.org/viewvc?rev=1024070&view=rev
Log:
[CXF-3072] Added support for PKCS#11 providers.

Modified:
    cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/configuration/jsse/spring/TLSParameterJaxBUtils.java

Modified: cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/configuration/jsse/spring/TLSParameterJaxBUtils.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/configuration/jsse/spring/TLSParameterJaxBUtils.java?rev=1024070&r1=1024069&r2=1024070&view=diff
==============================================================================
--- cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/configuration/jsse/spring/TLSParameterJaxBUtils.java
(original)
+++ cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/configuration/jsse/spring/TLSParameterJaxBUtils.java
Tue Oct 19 00:28:54 2010
@@ -110,22 +110,26 @@ public final class TLSParameterJaxBUtils
                     ? KeyStore.getInstance(type)
                     : KeyStore.getInstance(type, kst.getProvider());
         
-        if (kst.isSetFile()) {
-            keyStore.load(new FileInputStream(kst.getFile()), password);
-        }
-        if (kst.isSetResource()) {
-            final java.io.InputStream is =
-                ClassLoaderUtils.getResourceAsStream(kst.getResource(), kst.getClass());
-            if (is == null) {
-                final String msg =
-                    "Could not load keystore resource " + kst.getResource();
-                LOG.severe(msg);
-                throw new java.io.IOException(msg);
+        if (!"PKCS11".equals(type)) {
+            if (kst.isSetFile()) {
+                keyStore.load(new FileInputStream(kst.getFile()), password);
             }
-            keyStore.load(is, password);
-        }
-        if (kst.isSetUrl()) {
-            keyStore.load(new URL(kst.getUrl()).openStream(), password);
+            if (kst.isSetResource()) {
+                final java.io.InputStream is =
+                    ClassLoaderUtils.getResourceAsStream(kst.getResource(), kst.getClass());
+                if (is == null) {
+                    final String msg =
+                        "Could not load keystore resource " + kst.getResource();
+                    LOG.severe(msg);
+                    throw new java.io.IOException(msg);
+                }
+                keyStore.load(is, password);
+            }
+            if (kst.isSetUrl()) {
+                keyStore.load(new URL(kst.getUrl()).openStream(), password);
+            }
+        } else {
+            keyStore.load(null, password);
         }
         return keyStore;
     }



Mime
View raw message