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 DED7117823 for ; Fri, 10 Oct 2014 10:03:49 +0000 (UTC) Received: (qmail 19616 invoked by uid 500); 10 Oct 2014 10:03:49 -0000 Delivered-To: apmail-cxf-commits-archive@cxf.apache.org Received: (qmail 19560 invoked by uid 500); 10 Oct 2014 10:03:49 -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 19551 invoked by uid 99); 10 Oct 2014 10:03:49 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 10 Oct 2014 10:03:49 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 52AFE19ABD; Fri, 10 Oct 2014 10:03:49 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: sergeyb@apache.org To: commits@cxf.apache.org Message-Id: X-Mailer: ASF-Git Admin Mailer Subject: git commit: Minor update to JwkUtils Date: Fri, 10 Oct 2014 10:03:49 +0000 (UTC) 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 Authored: Fri Oct 10 11:03:30 2014 +0100 Committer: Sergey Beryozkin 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);