cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cohei...@apache.org
Subject [3/4] cxf git commit: Make it possible to use JAX-WS properties with the compact JWS use-case
Date Mon, 27 Apr 2015 15:40:06 GMT
Make it possible to use JAX-WS properties with the compact JWS use-case


Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/3e8d71b4
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/3e8d71b4
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/3e8d71b4

Branch: refs/heads/master
Commit: 3e8d71b42b3cf74b15080fad9769330992e384ca
Parents: c4aac43
Author: Colm O hEigeartaigh <coheigea@apache.org>
Authored: Mon Apr 27 15:25:49 2015 +0100
Committer: Colm O hEigeartaigh <coheigea@apache.org>
Committed: Mon Apr 27 16:39:58 2015 +0100

----------------------------------------------------------------------
 .../security/jose/jaxrs/KeyManagementUtils.java | 25 +++++++++++++++++++-
 1 file changed, 24 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/3e8d71b4/rt/rs/security/jose/src/main/java/org/apache/cxf/rs/security/jose/jaxrs/KeyManagementUtils.java
----------------------------------------------------------------------
diff --git a/rt/rs/security/jose/src/main/java/org/apache/cxf/rs/security/jose/jaxrs/KeyManagementUtils.java
b/rt/rs/security/jose/src/main/java/org/apache/cxf/rs/security/jose/jaxrs/KeyManagementUtils.java
index 0447a19..799a0c1 100644
--- a/rt/rs/security/jose/src/main/java/org/apache/cxf/rs/security/jose/jaxrs/KeyManagementUtils.java
+++ b/rt/rs/security/jose/src/main/java/org/apache/cxf/rs/security/jose/jaxrs/KeyManagementUtils.java
@@ -297,6 +297,9 @@ public final class KeyManagementUtils {
     }
     public static String getKeyAlgorithm(Message m, Properties props, String propName, String
defaultAlg) {
         String algo = props.getProperty(propName);
+        if (algo == null) {
+            algo = (String)m.getContextualProperty(propName);
+        }
         if (algo == null && PropertyUtils.isTrue(m.getContextualProperty(RSSEC_DEFAULT_ALGORITHMS)))
{
             algo = defaultAlg;
         }
@@ -325,12 +328,32 @@ public final class KeyManagementUtils {
             String keyFile = (String)m.getContextualProperty(RSSEC_KEY_STORE_FILE);
             if (keyFile != null) {
                 props = new Properties();
-                props.setProperty(KeyManagementUtils.RSSEC_KEY_STORE_FILE, keyFile);
+                props.setProperty(RSSEC_KEY_STORE_FILE, keyFile);
                 String type = (String)m.getContextualProperty(RSSEC_KEY_STORE_TYPE);
                 if (type == null) {
                     type = "jwk";
                 }
                 props.setProperty(RSSEC_KEY_STORE_TYPE, type);
+                String alias = (String)m.getContextualProperty(RSSEC_KEY_STORE_ALIAS);
+                if (alias != null) {
+                    props.setProperty(RSSEC_KEY_STORE_ALIAS, alias);
+                }
+                String keystorePassword = (String)m.getContextualProperty(RSSEC_KEY_STORE_PSWD);
+                if (keystorePassword != null) {
+                    props.setProperty(RSSEC_KEY_STORE_PSWD, keystorePassword);
+                }
+                String keyPassword = (String)m.getContextualProperty(RSSEC_KEY_PSWD);
+                if (keyPassword != null) {
+                    props.setProperty(RSSEC_KEY_PSWD, keyPassword);
+                }
+                String signatureProvider = (String)m.getContextualProperty(RSSEC_SIG_KEY_PSWD_PROVIDER);
+                if (signatureProvider != null) {
+                    props.setProperty(RSSEC_SIG_KEY_PSWD_PROVIDER, signatureProvider);
+                }
+                String keyProvider = (String)m.getContextualProperty(RSSEC_KEY_PSWD_PROVIDER);
+                if (keyProvider != null) {
+                    props.setProperty(RSSEC_KEY_PSWD_PROVIDER, keyProvider);
+                }
             }
         }
         if (props == null && required) { 


Mime
View raw message