cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject cxf git commit: Passing an optional X509 cert alias via modifyable Properties as agreed with Colm
Date Wed, 28 Oct 2015 12:18:03 GMT
Repository: cxf
Updated Branches:
  refs/heads/3.0.x-fixes 5df9846b8 -> e7ca0746f


Passing an optional X509 cert alias via modifyable Properties as agreed with Colm


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

Branch: refs/heads/3.0.x-fixes
Commit: e7ca0746fa653832572b3547276ab361c37fb7c6
Parents: 5df9846
Author: Sergey Beryozkin <sberyozkin@gmail.com>
Authored: Wed Oct 28 12:15:52 2015 +0000
Committer: Sergey Beryozkin <sberyozkin@gmail.com>
Committed: Wed Oct 28 12:17:31 2015 +0000

----------------------------------------------------------------------
 .../apache/cxf/rs/security/jose/common/KeyManagementUtils.java  | 5 ++++-
 .../cxf/rs/security/jose/common/PrivateKeyPasswordProvider.java | 2 +-
 .../main/java/org/apache/cxf/rs/security/jose/jwk/JwkUtils.java | 2 +-
 .../apache/cxf/systest/jaxrs/security/jwt/JAXRSJweJwsTest.java  | 2 +-
 .../jaxrs/security/jwt/PrivateKeyPasswordProviderImpl.java      | 2 +-
 5 files changed, 8 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/e7ca0746/rt/rs/security/jose-parent/jose/src/main/java/org/apache/cxf/rs/security/jose/common/KeyManagementUtils.java
----------------------------------------------------------------------
diff --git a/rt/rs/security/jose-parent/jose/src/main/java/org/apache/cxf/rs/security/jose/common/KeyManagementUtils.java
b/rt/rs/security/jose-parent/jose/src/main/java/org/apache/cxf/rs/security/jose/common/KeyManagementUtils.java
index 3eb4637..bb771a6 100644
--- a/rt/rs/security/jose-parent/jose/src/main/java/org/apache/cxf/rs/security/jose/common/KeyManagementUtils.java
+++ b/rt/rs/security/jose-parent/jose/src/main/java/org/apache/cxf/rs/security/jose/common/KeyManagementUtils.java
@@ -146,7 +146,10 @@ public final class KeyManagementUtils {
         
         String keyPswd = props.getProperty(JoseConstants.RSSEC_KEY_PSWD);
         String theAlias = alias != null ? alias : getKeyId(m, props, JoseConstants.RSSEC_KEY_STORE_ALIAS,
keyOper);
-        char[] keyPswdChars = provider != null ? provider.getPassword(theAlias, props) 
+        if (theAlias != null) {
+            props.put(JoseConstants.RSSEC_KEY_STORE_ALIAS, theAlias);
+        }
+        char[] keyPswdChars = provider != null ? provider.getPassword(props) 
             : keyPswd != null ? keyPswd.toCharArray() : null;    
         return CryptoUtils.loadPrivateKey(keyStore, keyPswdChars, theAlias);
     }

http://git-wip-us.apache.org/repos/asf/cxf/blob/e7ca0746/rt/rs/security/jose-parent/jose/src/main/java/org/apache/cxf/rs/security/jose/common/PrivateKeyPasswordProvider.java
----------------------------------------------------------------------
diff --git a/rt/rs/security/jose-parent/jose/src/main/java/org/apache/cxf/rs/security/jose/common/PrivateKeyPasswordProvider.java
b/rt/rs/security/jose-parent/jose/src/main/java/org/apache/cxf/rs/security/jose/common/PrivateKeyPasswordProvider.java
index 86fb0e5..fc58ee5 100644
--- a/rt/rs/security/jose-parent/jose/src/main/java/org/apache/cxf/rs/security/jose/common/PrivateKeyPasswordProvider.java
+++ b/rt/rs/security/jose-parent/jose/src/main/java/org/apache/cxf/rs/security/jose/common/PrivateKeyPasswordProvider.java
@@ -21,5 +21,5 @@ package org.apache.cxf.rs.security.jose.common;
 import java.util.Properties;
 
 public interface PrivateKeyPasswordProvider {
-    char[] getPassword(String alias, Properties storeProperties); 
+    char[] getPassword(Properties storeProperties); 
 }

http://git-wip-us.apache.org/repos/asf/cxf/blob/e7ca0746/rt/rs/security/jose-parent/jose/src/main/java/org/apache/cxf/rs/security/jose/jwk/JwkUtils.java
----------------------------------------------------------------------
diff --git a/rt/rs/security/jose-parent/jose/src/main/java/org/apache/cxf/rs/security/jose/jwk/JwkUtils.java
b/rt/rs/security/jose-parent/jose/src/main/java/org/apache/cxf/rs/security/jose/jwk/JwkUtils.java
index b45b4bc..a85d4dc 100644
--- a/rt/rs/security/jose-parent/jose/src/main/java/org/apache/cxf/rs/security/jose/jwk/JwkUtils.java
+++ b/rt/rs/security/jose-parent/jose/src/main/java/org/apache/cxf/rs/security/jose/jwk/JwkUtils.java
@@ -267,7 +267,7 @@ public final class JwkUtils {
                                          JwkReaderWriter reader) {
         JweDecryptionProvider decryption = cb != null
             ? new AesCbcHmacJweDecryption(new PbesHmacAesWrapKeyDecryptionAlgorithm(
-                cb.getPassword(null, props))) : null;
+                cb.getPassword(props))) : null;
         return loadJwkSet(props, bus, decryption, reader);
     }
     public static JsonWebKeys loadJwkSet(Properties props, Bus bus, JweDecryptionProvider
jwe, JwkReaderWriter reader) {

http://git-wip-us.apache.org/repos/asf/cxf/blob/e7ca0746/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/jwt/JAXRSJweJwsTest.java
----------------------------------------------------------------------
diff --git a/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/jwt/JAXRSJweJwsTest.java
b/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/jwt/JAXRSJweJwsTest.java
index b65ff32..56117d5 100644
--- a/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/jwt/JAXRSJweJwsTest.java
+++ b/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/jwt/JAXRSJweJwsTest.java
@@ -473,7 +473,7 @@ public class JAXRSJweJwsTest extends AbstractBusClientServerTestBase {
             this.password = password;
         }
         @Override
-        public char[] getPassword(String alias, Properties storeProperties) {
+        public char[] getPassword(Properties storeProperties) {
             return password.toCharArray();
         }
         

http://git-wip-us.apache.org/repos/asf/cxf/blob/e7ca0746/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/jwt/PrivateKeyPasswordProviderImpl.java
----------------------------------------------------------------------
diff --git a/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/jwt/PrivateKeyPasswordProviderImpl.java
b/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/jwt/PrivateKeyPasswordProviderImpl.java
index f01ea93..d9d7153 100644
--- a/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/jwt/PrivateKeyPasswordProviderImpl.java
+++ b/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/jwt/PrivateKeyPasswordProviderImpl.java
@@ -32,7 +32,7 @@ public class PrivateKeyPasswordProviderImpl implements PrivateKeyPasswordProvide
         this.password = password;
     }
     @Override
-    public char[] getPassword(String alias, Properties storeProperties) {
+    public char[] getPassword(Properties storeProperties) {
         return password.toCharArray();
     }
     


Mime
View raw message