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:03:49 GMT
Repository: cxf
Updated Branches:
  refs/heads/master e1e100052 -> d1767a6b0


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

Branch: refs/heads/master
Commit: d1767a6b0780bfcbe342a1749ee46f758e30d577
Parents: e1e1000
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:03:30 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/d1767a6b/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