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:16:08 GMT
Repository: cxf
Updated Branches:
  refs/heads/master 45eb8f254 -> 890bb46cc


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/890bb46c
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/890bb46c
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/890bb46c

Branch: refs/heads/master
Commit: 890bb46cc455b3ad8dec5076a1bb2ad10aca435d
Parents: 45eb8f2
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:15:52 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/890bb46c/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/890bb46c/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/890bb46c/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/890bb46c/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 8a8bd74..84f3553 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
@@ -439,7 +439,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/890bb46c/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