cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject git commit: Minor update to JwkUtils
Date Fri, 10 Oct 2014 10:05:20 GMT
Repository: cxf
Updated Branches:
  refs/heads/3.0.x-fixes 45554c124 -> b38cfb6fc


Minor update to JwkUtils


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

Branch: refs/heads/3.0.x-fixes
Commit: b38cfb6fcc1f3d0ce2cc3b98ee1394e911efbab4
Parents: 45554c1
Author: Sergey Beryozkin <sberyozkin@talend.com>
Authored: Fri Oct 10 11:03:30 2014 +0100
Committer: Sergey Beryozkin <sberyozkin@talend.com>
Committed: Fri Oct 10 11:04:46 2014 +0100

----------------------------------------------------------------------
 .../org/apache/cxf/rs/security/jose/jwk/JwkUtils.java    | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/b38cfb6f/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 c994b1e..3c583fb 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
@@ -21,6 +21,7 @@ package org.apache.cxf.rs.security.jose.jwk;
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.UnsupportedEncodingException;
+import java.net.URI;
 import java.security.interfaces.ECPrivateKey;
 import java.security.interfaces.ECPublicKey;
 import java.security.interfaces.RSAPrivateKey;
@@ -55,11 +56,17 @@ public final class JwkUtils {
     private JwkUtils() {
         
     }
+    public static JsonWebKey readJwkKey(URI uri) throws IOException {
+        return readJwkKey(uri.toURL().openStream());
+    }
+    public static JsonWebKeys readJwkSet(URI uri) throws IOException {
+        return readJwkSet(uri.toURL().openStream());
+    }
     public static JsonWebKey readJwkKey(InputStream is) throws IOException {
-        return new DefaultJwkReaderWriter().jsonToJwk(IOUtils.readStringFromStream(is));
+        return readJwkKey(IOUtils.readStringFromStream(is));
     }
     public static JsonWebKeys readJwkSet(InputStream is) throws IOException {
-        return new DefaultJwkReaderWriter().jsonToJwkSet(IOUtils.readStringFromStream(is));
+        return readJwkSet(IOUtils.readStringFromStream(is));
     }
     public static JsonWebKey readJwkKey(String jwkJson) {
         return new DefaultJwkReaderWriter().jsonToJwk(jwkJson);


Mime
View raw message