Return-Path: X-Original-To: apmail-cxf-commits-archive@www.apache.org Delivered-To: apmail-cxf-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id E01D6182EE for ; Thu, 6 Aug 2015 14:46:25 +0000 (UTC) Received: (qmail 74628 invoked by uid 500); 6 Aug 2015 14:46:25 -0000 Delivered-To: apmail-cxf-commits-archive@cxf.apache.org Received: (qmail 74538 invoked by uid 500); 6 Aug 2015 14:46:25 -0000 Mailing-List: contact commits-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cxf.apache.org Delivered-To: mailing list commits@cxf.apache.org Received: (qmail 74434 invoked by uid 99); 6 Aug 2015 14:46:25 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 06 Aug 2015 14:46:25 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 844A0E6B7E; Thu, 6 Aug 2015 14:46:25 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: coheigea@apache.org To: commits@cxf.apache.org Date: Thu, 06 Aug 2015 14:46:25 -0000 Message-Id: <192894623cb14af1b6a2014ffa051dbf@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [1/2] cxf git commit: Fixing some issues thrown up by analysis.apache.org Repository: cxf Updated Branches: refs/heads/3.0.x-fixes dd0340f1d -> 2d81cd8f0 Fixing some issues thrown up by analysis.apache.org Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/a727d21f Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/a727d21f Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/a727d21f Branch: refs/heads/3.0.x-fixes Commit: a727d21fa73bd8d5753782eb20f01034e7e4ea48 Parents: dd0340f Author: Colm O hEigeartaigh Authored: Thu Aug 6 15:43:55 2015 +0100 Committer: Colm O hEigeartaigh Committed: Thu Aug 6 15:44:47 2015 +0100 ---------------------------------------------------------------------- .../apache/cxf/rs/security/jose/jwk/JsonWebKeys.java | 12 ++++++++---- .../org/apache/cxf/rs/security/jose/jwk/JwkUtils.java | 2 +- 2 files changed, 9 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cxf/blob/a727d21f/rt/rs/security/jose/src/main/java/org/apache/cxf/rs/security/jose/jwk/JsonWebKeys.java ---------------------------------------------------------------------- diff --git a/rt/rs/security/jose/src/main/java/org/apache/cxf/rs/security/jose/jwk/JsonWebKeys.java b/rt/rs/security/jose/src/main/java/org/apache/cxf/rs/security/jose/jwk/JsonWebKeys.java index 1ca3ca8..55a19f6 100644 --- a/rt/rs/security/jose/src/main/java/org/apache/cxf/rs/security/jose/jwk/JsonWebKeys.java +++ b/rt/rs/security/jose/src/main/java/org/apache/cxf/rs/security/jose/jwk/JsonWebKeys.java @@ -112,15 +112,19 @@ public class JsonWebKeys extends JsonMapObject { return map; } public List getKeys(String keyType) { - return getKeyTypeMap().get(keyType); + KeyType kt = KeyType.getKeyType(keyType); + if (kt == null) { + return null; + } + return getKeyTypeMap().get(kt); } public List getRsaKeys() { - return getKeyTypeMap().get(JsonWebKey.KEY_TYPE_RSA); + return getKeyTypeMap().get(KeyType.RSA); } public List getEllipticKeys() { - return getKeyTypeMap().get(JsonWebKey.KEY_TYPE_ELLIPTIC); + return getKeyTypeMap().get(KeyType.EC); } public List getSecretKeys() { - return getKeyTypeMap().get(JsonWebKey.KEY_TYPE_OCTET); + return getKeyTypeMap().get(KeyType.OCTET); } } http://git-wip-us.apache.org/repos/asf/cxf/blob/a727d21f/rt/rs/security/jose/src/main/java/org/apache/cxf/rs/security/jose/jwk/JwkUtils.java ---------------------------------------------------------------------- diff --git a/rt/rs/security/jose/src/main/java/org/apache/cxf/rs/security/jose/jwk/JwkUtils.java b/rt/rs/security/jose/src/main/java/org/apache/cxf/rs/security/jose/jwk/JwkUtils.java index e1f161c..f996178 100644 --- a/rt/rs/security/jose/src/main/java/org/apache/cxf/rs/security/jose/jwk/JwkUtils.java +++ b/rt/rs/security/jose/src/main/java/org/apache/cxf/rs/security/jose/jwk/JwkUtils.java @@ -512,7 +512,7 @@ public final class JwkUtils { } public static void setPublicKeyInfo(JsonWebKey jwk, JoseHeaders headers, String algo, boolean reportPublicKey, boolean reportPublicKeyId) { - if (reportPublicKey && JsonWebKey.KEY_TYPE_RSA.equals(jwk.getKeyType())) { + if (reportPublicKey && KeyType.RSA.equals(jwk.getKeyType())) { List chain = CastUtils.cast((List)jwk.getProperty("x5c")); //TODO: if needed the chain can be reported as part of a 'jwk' property if (chain != null) {