Re: [jose] #16: URI identifying a specific key in a JWK set

"Manger, James H" <James.H.Manger@team.telstra.com> Mon, 15 April 2013 00:35 UTC

Return-Path: <James.H.Manger@team.telstra.com>
X-Original-To: jose@ietfa.amsl.com
Delivered-To: jose@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 0C5F021F8EAC for <jose@ietfa.amsl.com>; Sun, 14 Apr 2013 17:35:08 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -0.901
X-Spam-Level:
X-Spam-Status: No, score=-0.901 tagged_above=-999 required=5 tests=[AWL=0.000, BAYES_00=-2.599, HELO_EQ_AU=0.377, HOST_EQ_AU=0.327, RELAY_IS_203=0.994]
Received: from mail.ietf.org ([12.22.58.30]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id gGlmWg92FBRw for <jose@ietfa.amsl.com>; Sun, 14 Apr 2013 17:35:07 -0700 (PDT)
Received: from ipxbno.tcif.telstra.com.au (ipxbno.tcif.telstra.com.au [203.35.82.204]) by ietfa.amsl.com (Postfix) with ESMTP id 08D5721F8CEC for <jose@ietf.org>; Sun, 14 Apr 2013 17:35:06 -0700 (PDT)
X-IronPort-AV: E=Sophos;i="4.87,472,1363093200"; d="scan'208";a="123885177"
Received: from unknown (HELO ipcani.tcif.telstra.com.au) ([10.97.216.200]) by ipobni.tcif.telstra.com.au with ESMTP; 15 Apr 2013 10:35:05 +1000
X-IronPort-AV: E=McAfee;i="5400,1158,7045"; a="75801493"
Received: from wsmsg3757.srv.dir.telstra.com ([172.49.40.85]) by ipcani.tcif.telstra.com.au with ESMTP; 15 Apr 2013 10:35:05 +1000
Received: from WSMSG3153V.srv.dir.telstra.com ([172.49.40.159]) by wsmsg3757.srv.dir.telstra.com ([172.49.40.85]) with mapi; Mon, 15 Apr 2013 10:35:05 +1000
From: "Manger, James H" <James.H.Manger@team.telstra.com>
To: jose issue tracker <trac+jose@trac.tools.ietf.org>, "draft-ietf-jose-json-web-key@tools.ietf.org" <draft-ietf-jose-json-web-key@tools.ietf.org>, "ietf@augustcellars.com" <ietf@augustcellars.com>
Date: Mon, 15 Apr 2013 10:35:04 +1000
Thread-Topic: [jose] #16: URI identifying a specific key in a JWK set
Thread-Index: Ac4xU15fNfmsQ7yYSqO2+X7moy0zYgHux8yg
Message-ID: <255B9BB34FB7D647A506DC292726F6E1150C74DB3E@WSMSG3153V.srv.dir.telstra.com>
References: <058.7d398c285ac07c1a4b2f1bfd0d8b7312@trac.tools.ietf.org> <073.1dc661959a15caad46917baec89b3440@trac.tools.ietf.org>
In-Reply-To: <073.1dc661959a15caad46917baec89b3440@trac.tools.ietf.org>
Accept-Language: en-US, en-AU
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
acceptlanguage: en-US, en-AU
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64
MIME-Version: 1.0
Cc: "jose@ietf.org" <jose@ietf.org>
Subject: Re: [jose] #16: URI identifying a specific key in a JWK set
X-BeenThere: jose@ietf.org
X-Mailman-Version: 2.1.12
Precedence: list
List-Id: Javascript Object Signing and Encryption <jose.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/jose>, <mailto:jose-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/jose>
List-Post: <mailto:jose@ietf.org>
List-Help: <mailto:jose-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/jose>, <mailto:jose-request@ietf.org?subject=subscribe>
X-List-Received-Date: Mon, 15 Apr 2013 00:35:08 -0000

> #16: URI identifying a specific key in a JWK set
>> http://trac.tools.ietf.org/wg/jose/trac/ticket/16

>  In order to evaluate this, we need to get a more detailed proposal

Below is a more detailed proposal. The basic idea is to make the JWK key set syntax a bit more sensible (keys named by their ids; instead of a "keys" element holding an array of keys); give key sets a media type; and define the fragment to be a JSON pointer [RFC 6901]. Then a URI can identify a specific key. A "jku" value can precisely indicate the key needed to process a JOSE message, eg "jku":"https://example.com/alice.keys#/k1".


>  1.  Syntax of the fragment

The fragment, if present, identifies a specific key in the JWK key set.

The fragment SHALL be a JSON Pointer [RFC 6901], pointing to the JSON object holding the specific key of interest within the set of keys.

The fragment SHALL be a "/" character followed by the key identifier ("kid" value) for the specific key.

[This implies the top-level structure of a JWK key set is changed to be a JSON object whose elements are individual keys. An element's name is the identifier of the key ("kid" value); an element's value is a single JWK object. One element (named "meta") is special: it is not a "kid" value, but a place to hold any metadata about the whole set of keys.

Example:
  {
    "k1" : {"kty":"EC","crv":"P-256","x":…,"y":…},
     2011-04-29" : {"kty":RSA","n":…,"e":"AQAB"}
  }
]


>  2.  dealing with duplicate values within a JWK structure

I'm not sure what this issue is. I suspect it is solved by storing keys as object elements as opposed to array items.

>  3.  Definition of a new media type - is this required or not - justify
>  either postion

The JWK spec should define a media type, such as application/keys+json.
Fragments are specific to a media type so a media type needs to be defined.

>  4.  Explain why the proposal is "better" than the current ability to
> have a url plus the kid in the message.

The whole concept of a URI is to be an identifier itself (not just when combined with a second field). Many, many systems and protocols that support URIs assume that the URI alone is sufficient to identify the item of interest.
It simplifies APIs and protocols: just pass 1 value.

>  5.  Discuss what happens if the fragment is not present on the url

The specs should be written so that if there is no fragment but there is only 1 key in the identified JWK key set, then things still work.

I suggest saying a *creator* of a "jku" URI value (to identify the specific key required to process a JOSE message) MUST include a fragment to identify a single key. When a key set has only 1 key, a *receiver* MUST accept a "jku" URI as an identifier of that 1 key even if the URI has no fragment.

> or if the fragment is not findable in the resultant document.

Then the URI identifies a key that is not present so an error results (similar to getting a 404 Not Found for the whole key set).

>  If the fragment
>  is going to be manditory does them mean that we should be doing a new
>  scheme instead as fragments cannot be required under the current URL
>  syntax defintions (or at least that is my reading).

Definitely no new URI scheme.
A URI without a fragment is still a valid URI. That doesn't stop us saying a "jku" URI value MUST contain a fragment.

>  Please flesh out your proposal more so that it can be fully evaluated.

I hope this email has fleshed out a proposal sufficiently.

--
James Manger