cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cohei...@apache.org
Subject cxf git commit: Fixing some issues thrown up by analysis.apache.org
Date Thu, 06 Aug 2015 14:44:22 GMT
Repository: cxf
Updated Branches:
  refs/heads/master 69bca0830 -> 3a72794e7


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

Branch: refs/heads/master
Commit: 3a72794e70164aff749509b7fb2d94b06d47ea39
Parents: 69bca08
Author: Colm O hEigeartaigh <coheigea@apache.org>
Authored: Thu Aug 6 15:43:55 2015 +0100
Committer: Colm O hEigeartaigh <coheigea@apache.org>
Committed: Thu Aug 6 15:44:17 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/3a72794e/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<JsonWebKey> getKeys(String keyType) {
-        return getKeyTypeMap().get(keyType);
+        KeyType kt = KeyType.getKeyType(keyType);
+        if (kt == null) {
+            return null;
+        }
+        return getKeyTypeMap().get(kt);
     }
     public List<JsonWebKey> getRsaKeys() {
-        return getKeyTypeMap().get(JsonWebKey.KEY_TYPE_RSA);
+        return getKeyTypeMap().get(KeyType.RSA);
     }
     public List<JsonWebKey> getEllipticKeys() {
-        return getKeyTypeMap().get(JsonWebKey.KEY_TYPE_ELLIPTIC);
+        return getKeyTypeMap().get(KeyType.EC);
     }
     public List<JsonWebKey> getSecretKeys() {
-        return getKeyTypeMap().get(JsonWebKey.KEY_TYPE_OCTET);
+        return getKeyTypeMap().get(KeyType.OCTET);
     }
 }

http://git-wip-us.apache.org/repos/asf/cxf/blob/3a72794e/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<String> chain = CastUtils.cast((List<?>)jwk.getProperty("x5c"));
             //TODO: if needed the chain can be reported as part of a 'jwk' property
             if (chain != null) {


Mime
View raw message