Repository: cxf Updated Branches: refs/heads/3.0.x-fixes f26cbcc51 -> d540894af
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/2b90127c Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/2b90127c Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/2b90127c Branch: refs/heads/3.0.x-fixes Commit: 2b90127c149dba99d129fc22c785c9903a5abb26 Parents: f26cbcc Author: Colm O hEigeartaigh <cohei...@apache.org> Authored: Mon Apr 27 15:25:49 2015 +0100 Committer: Colm O hEigeartaigh <cohei...@apache.org> Committed: Mon Apr 27 16:40:20 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/2b90127c/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) {