<?xml version="1.0" encoding="us-ascii"?>
<?xml-stylesheet type='text/xsl' href='http://xml2rfc.tools.ietf.org/authoring/rfc2629.xslt' ?>
<!DOCTYPE rfc SYSTEM "rfc2629.dtd">

<?rfc toc="yes"?>
<?rfc tocompact="yes"?>
<?rfc tocdepth="4"?>
<?rfc tocindent="yes"?>
<?rfc symrefs="yes"?>
<?rfc sortrefs="yes"?>
<?rfc comments="yes"?>
<?rfc inline="yes"?>
<?rfc compact="yes"?>
<?rfc subcompact="no"?>

<rfc category="std" docName="draft-ietf-oauth-jwk-thumbprint-uri-01"
     ipr="trust200902">
  <front>
    <title abbrev="JWK Thumbprint URI">JWK Thumbprint URI</title>

    <author fullname="Michael B. Jones" initials="M.B." surname="Jones">
      <organization>Microsoft</organization>
      <address>
        <email>mbj@microsoft.com</email>
        <uri>https://self-issued.info/</uri>
      </address>
    </author>
    <author fullname="Kristina Yasuda" initials="K." surname="Yasuda">
      <organization>Microsoft</organization>
      <address>
        <email>kryasuda@microsoft.com</email>
        <uri>https://twitter.com/kristinayasuda</uri>
      </address>
    </author>

    <date day="14" month="February" year="2022"/>

    <area>Security</area>
    <workgroup>OAuth Working Group</workgroup>

    <keyword>RFC</keyword>
    <keyword>Request for Comments</keyword>
    <keyword>I-D</keyword>
    <keyword>Internet-Draft</keyword>
    <keyword>JSON Web Key</keyword>
    <keyword>JWK</keyword>
    <keyword>Thumbprint</keyword>
    <keyword>URI</keyword>
    <keyword>URN</keyword>
    <keyword>OAuth</keyword>

    <abstract>
      <t>
	This specification registers a kind of URI that represents
  a JSON Web Key (JWK) Thumbprint value.
	JWK Thumbprints are defined in RFC 7638.
	This enables JWK Thumbprints to be used,
	for instance, as key identifiers in contexts requiring URIs.
      </t>
    </abstract>

  </front>

  <middle>
    <section anchor="Introduction" title="Introduction">
      <t>
	A JSON Web Key (JWK) Thumbprint <xref target="RFC7638"/>
	is a URL-safe representation of a hash value over a JSON Web Key (JWK) <xref target="RFC7517"/>.
	This specification defines a URI prefix indicating that the
	portion of the URI following the prefix is a JWK Thumbprint.
	This enables JWK Thumbprints to be communicated in contexts requiring URIs,
	including in specific JSON Web Token (JWT) <xref target="RFC7519"/> claims.
      </t>
      <t>
	JWK Thumbprints URIs are being used in the <xref target="SIOPv2"/> specification
	as one kind of subject identifier in a context requiring that the identifier be a URI.
	In this case, the subject identifier is derived from a public key represented as a JWK.
	Expressing the identifier as JWK Thumbprint URI enables this kind of identifier
	to be differentiated from other kinds of identifiers that are also URIs,
	such as Decentralized Identifiers (DIDs) <xref target="DID-Core"/>.
      </t>
    </section>

    <section anchor="RNC" title="Requirements Notation and Conventions">
      <t>
	The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
	"SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL"
	in this document are to be interpreted as described in
	BCP 14 <xref target="RFC2119"/> <xref target="RFC8174"/>
	when, and only when, they appear in all capitals, as shown here.
      </t>
    </section>

    <section anchor="JKTURI" title="JWK Thumbprint URI">
      <t>
	The following URI prefix is defined to indicate that the
	portion of the URI following the prefix is a JWK Thumbprint:
      </t>
      <t>
	<list style="symbols">
	  <t><spanx style='verb'>urn:ietf:params:oauth:jwk-thumbprint</spanx></t>
	</list>
      </t>
      <t>
	To make it explicit in a URI which hash algorithm is used,
  the prefix is followed by a hash algorithm identifier and a JWK Thumbprint value,
  each separated by a colon character to form a URI representing a JWK Thumbprint.
      </t>
    </section>

      <section anchor="HashAlgorithms" title="Hash Algorithms Identifier">
  <t>
  Hash algorithm identifiers used in JWK Thumbprint URIs are strings
  registered in the IANA "Named Information Hash Algorithm Registry" <xref target="IANA.Hash.Algorithms"/>.
  </t>
    </section>

  <section anchor="MTI" title="Mandatory to Implement Hash Algorithm">
	<t>
	  To promote interoperability among implementations,
	  the SHA-256 hash algorithm is mandatory to implement.
	</t>
    </section>

      <section anchor="Example" title="Example JWK Thumbprint URI">
	<t>
	  Section 3.1 of <xref target="RFC7638"/> contains the following example JWK Thumbprint value:
	</t>
	<figure><artwork><![CDATA[
  NzbLsXh8uDCcd-6MNwXF4W_7noWXFZAfHkxZsRGC9Xs
]]></artwork></figure>

	<t>
	  A complete JWK Thumbprint URI using the above JWK Thumbprint and SHA-256 hash algorithm is:
	</t>
	<figure><artwork><![CDATA[
  urn:ietf:params:oauth:jwk-thumbprint:sha-256:NzbLsXh8uDCcd-6MNwXF4W_7noWXFZAfHkxZsRGC9Xs
]]></artwork></figure>
      </section>


    <section anchor="Security" title="Security Considerations">
      <t>
        The security considerations of <xref target="RFC7638"/>
	also apply when using this specification.
      </t>

      <section anchor="MultiplePublicKeysPerPrivateKey" title="Multiple Public Keys per Private Key">
	<t>
	  There are cryptographic algorithms for which multiple public keys correspond to the same private key.
	  This is described in the security considerations of <xref target="RFC7748"/> as follows:
	</t>
	<t>
	  <list style="empty">
	    <t>
	      Designers using these curves should be aware that for each public
	      key, there are several publicly computable public keys that are
	      equivalent to it, i.e., they produce the same shared secrets.  Thus
	      using a public key as an identifier and knowledge of a shared secret
	      as proof of ownership (without including the public keys in the key
	      derivation) might lead to subtle vulnerabilities.
	    </t>
	  </list>
	</t>
	<t>
	  This consideration for public keys as identifiers equally applies to JWK Thumbprint URIs used as identifiers.
	  A recommended way to ensure that the JWK Thumbprint URI corresponds to the actual
	  public key used is to sign a message containing the correct public key with the private key.
	  This signed message could also contain the JWK Thumbprint URI
	  (although, by definition, it could also be computed directly from the public key).
	</t>
      </section>
    </section>

    <section anchor="IANA" title="IANA Considerations">

      <section anchor="URIReg" title="OAuth URI Registration">

	<t>
	  This specification registers the following value in the
	  IANA "OAuth URI" registry
	  <xref target="IANA.OAuth.Parameters"/>
	  established by <xref target="RFC6755"/>.
	</t>

	<section title="Registry Contents" anchor="URIContents">

	  <t>
	    <?rfc subcompact="yes"?>
	    <list style="symbols">
	      <t>URN: urn:ietf:params:oauth:jwk-thumbprint</t>
	      <t>Common Name: JWK Thumbprint URI</t>
	      <t>Change controller: IESG</t>
	      <t>Specification Document: [[ this specification ]]</t>
	    </list>
	  </t>
	  <?rfc subcompact="no"?>

	</section>
      </section>

    </section>

  </middle>

  <back>
    <references title="Normative References">
      <?rfc include='http://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.2119.xml' ?>
      <?rfc include='http://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.7638.xml' ?>
      <?rfc include="http://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.8174.xml"?>

      <reference anchor="IANA.OAuth.Parameters" target="http://www.iana.org/assignments/oauth-parameters">
        <front>
          <title>OAuth Parameters</title>
          <author>
            <organization>IANA</organization>
          </author>
	  <date/>
        </front>
      </reference>

    </references>

    <references title="Informative References">
      <?rfc include='http://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.6755.xml' ?>
      <?rfc include='http://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.7517.xml' ?>
      <?rfc include='http://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.7519.xml' ?>
      <?rfc include='http://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.7748.xml' ?>

      <reference anchor="IANA.Hash.Algorithms" target="https://www.iana.org/assignments/named-information/named-information.xhtml#hash-alg">
        <front>
          <title>Named Information Hash Algorithm Registry</title>
          <author>
           <organization>IANA</organization>
          </author>
          <date/>
        </front>
      </reference>

      <reference anchor="SIOPv2" target="https://openid.net/specs/openid-connect-self-issued-v2-1_0.html">
        <front>
          <title>Self-Issued OpenID Provider v2</title>
          <author fullname="Kristina Yasuda">
            <organization>Microsoft</organization>
          </author>
          <author fullname="Michael B. Jones">
            <organization>Microsoft</organization>
          </author>
	  <date day="18" month="December" year="2021"/>
        </front>
      </reference>

      <reference anchor="DID-Core" target="https://www.w3.org/TR/2021/PR-did-core-20210803/">
        <front>
	  <title>Decentralized Identifiers (DIDs) v1.0</title>
	  <author fullname="Manu Sporny">
            <organization>Digital Bazaar</organization>
	  </author>
	  <author fullname="Amy Guy">
            <organization>Digital Bazaar</organization>
	  </author>
	  <author fullname="Markus Sabadello">
            <organization>Danube Tech</organization>
	  </author>
	  <author fullname="Drummond Reed">
            <organization>Evernym</organization>
	  </author>
	  <date day="3" month="Aug" year="2021"/>
        </front>
      </reference>

    </references>

    <section anchor="Acknowledgements" title="Acknowledgements">
      <t>
	Use cases for this specification were developed in the
	OpenID Connect Working Group of the OpenID Foundation.
	Specifically, it is being used a key identifier in the
	<xref target="SIOPv2"/> specification.
      </t>
      <t>
        The following individuals also contributed to this specification:
	John Bradley,
	Brian Campbell,
	Vladimir Dzhuvinov,
        Adam Lemmon,
	Neil Madden,
	Aaron Parecki,
	and
	David Waite.
      </t>
    </section>

    <section anchor="History" title="Document History">
      <?rfc subcompact="yes"?>
      <t>
	[[ to be removed by the RFC Editor before publication as an RFC ]]
      </t>

      <t>
        -01
        <list style='symbols'>
          <t>
            Added security considerations about multiple public keys coresponding to the same private key.
            Added hash algorithm identifier after the JWK thumbprint URI prefix to make it explicit in a URI which hash algorithm is used.
            Added reference to a registry for hash algorithm identifiers.
            Added SHA-256 as a mandatory to implement hash algorithm to promote interoperability.
	  </t>
        </list>
      </t>

      <t>
        -00
        <list style='symbols'>
          <t>
            Created initial working group draft from draft-jones-oauth-jwk-thumbprint-uri-01.
	  </t>
        </list>
      </t>
      <?rfc subcompact="no"?>
    </section>

  </back>
</rfc>
