<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE rfc SYSTEM "rfc2629.dtd">

<?xml-stylesheet type="text/xsl" href="rfc2629.xslt" ?>
<?rfc toc="yes"?>
<?rfc tocdepth="4"?>
<?rfc symrefs="yes"?>
<?rfc sortrefs="yes"?>
<?rfc strict="yes"?>
<?rfc compact="yes"?>
<?rfc subcompact="no"?>

<rfc category="std" ipr="trust200902" docName="draft-ietf-ace-cbor-web-token-15">

  <front>
    <title abbrev="CBOR Web Token">CBOR Web Token (CWT)</title>

    <author fullname="Michael B. Jones" initials="M.B." surname="Jones">
      <organization>Microsoft</organization>
      <address>
	<email>mbj@microsoft.com</email>
	<uri>http://self-issued.info/</uri>
      </address>
    </author>

    <author initials="E." surname="Wahlström" fullname="Erik Wahlström">
      <organization></organization>
      <address>
	<postal>
	  <street></street>
	  <city></city>
	  <code></code>
	  <country>Sweden</country>
	</postal>
	<phone></phone>
	<email>erik@wahlstromstekniska.se</email>
      </address>
    </author>

    <author fullname="Samuel Erdtman" initials="S.E." surname="Erdtman">
      <organization>Spotify AB</organization>
      <address>
      	<postal>
      	  <street>Birger Jarlsgatan 61, 4tr</street>
      	  <city>Stockholm</city>
      	  <region></region>
      	  <code>113 56</code>
      	  <country>Sweden</country>
      	</postal>
      	<phone>+46702691499</phone>
      	<email>erdtman@spotify.com</email>
      </address>
    </author>

    <author fullname="Hannes Tschofenig" initials="H." surname="Tschofenig">
      <organization>ARM Ltd.</organization>
      <address>
	<postal>
	  <street></street>
	  <code>6060</code> <city>Hall in Tirol</city>
	  <country>Austria</country>
	</postal>
	<email>Hannes.Tschofenig@arm.com</email>
      </address>
    </author>

    <date day="19" month="March" year="2018" />

    <area>Security</area>
    <workgroup>ACE Working Group</workgroup>

    <keyword>Internet-Draft</keyword>
    <keyword>JSON Web Token</keyword>
    <keyword>JWT</keyword>
    <keyword>Claims</keyword>
    <keyword>Concise Binary Object Representation</keyword>
    <keyword>CBOR</keyword>
    <keyword>CBOR Object Signing and Encryption</keyword>
    <keyword>COSE</keyword>
    <keyword>OAuth</keyword>
    <keyword>ACE</keyword>

    <abstract>
      <t>
	CBOR Web Token (CWT) is a compact means of representing claims to be
	transferred between two parties. The claims in a
	CWT are encoded in the Concise Binary Object Representation (CBOR) and
	CBOR Object Signing and Encryption (COSE) is used for added application
	layer security protection.  A claim is a piece of information asserted
	about a subject and is represented as a name/value pair consisting of a
	claim name and a claim value.
	CWT is derived from JSON Web Token (JWT) but uses CBOR rather than JSON.
      </t>
    </abstract>

  </front>

  <middle>

    <!-- ====================================================================== -->

    <section anchor="Introduction" title="Introduction">

      <t>
	The JSON Web Token (JWT) <xref target="RFC7519"/> is a standardized security token format
	that has found use in OAuth 2.0 and OpenID Connect deployments, among other applications.
	JWT uses JSON Web Signature (JWS) <xref target="RFC7515"/> and
	JSON Web Encryption (JWE) <xref target="RFC7516"/> to secure the contents of the JWT,
	which is a set of claims represented in JSON.
	The use of JSON for encoding information is popular for
	Web and native applications, but it is considered inefficient for some
	Internet of Things (IoT) systems that use low power radio technologies.
      </t>

      <t>
	An alternative encoding of claims is defined in this document. Instead
	of using JSON, as provided by JWTs, this specification uses
	CBOR <xref target="RFC7049"/> and calls this new structure "CBOR Web Token (CWT)", which is a
	compact means of representing secured claims to be transferred between two
	parties. CWT is closely related to JWT. It references the JWT claims
	and both its name and pronunciation are derived from JWT. To protect the
	claims contained in CWTs, the CBOR Object Signing and Encryption (COSE)
	<xref target="RFC8152"/>
	specification is used.
      </t>

      <t>
	The suggested pronunciation of CWT is the same as the English word
	"cot".
      </t>
      <section anchor="CBORRelatedTerminology" title="CBOR Related Terminology">
	<t>
	  In JSON, maps are called objects and only have one kind of map key: a
	  string.  CBOR uses strings, negative integers, and unsigned
	  integers as map keys.  The integers are used for compactness of
	  encoding and easy comparison.  The inclusion of strings allows for an
	  additional range of short encoded values to be used.
	</t>
      </section>

    </section>

    <!-- /////////////////////////////////////////////////////////////////////// -->

    <section anchor="Terminology" title="Terminology">
      <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>
       <t>
	 This document reuses terminology from JWT
	 <xref target="RFC7519"/> and COSE <xref target="RFC8152"/>.
       </t>

      <t>
	<list style="hanging">
	  <t hangText="StringOrURI">
	    <vspace/>
	    The "StringOrURI" term in this specification has the same meaning and
	    processing rules as the JWT "StringOrURI" term defined in Section 2
	    of <xref target="RFC7519"/>, except that it is represented as
	    a CBOR text string instead of a JSON text string.
	   </t>

	  <t hangText="NumericDate">
	    <vspace/>
	    The "NumericDate" term in this specification has the same meaning and
	    processing rules as the JWT "NumericDate" term defined in Section 2
	    of <xref target="RFC7519"/>, except that it is represented as
	    a CBOR numeric date (from Section 2.4.1 of <xref target="RFC7049"/>) 
	    instead of a JSON number.
	    The encoding is modified so that the leading tag 1 (epoch-based date/time) MUST
	    be omitted.
	  </t>

	  <t hangText="Claim Name">
	    <vspace/>
	    The human-readable name used to identify a claim.
	  </t>

	  <t hangText="Claim Key">
	    <vspace/>
	    The CBOR map key used to identify a claim.
	  </t>

	  <t hangText="Claim Value">
	    <vspace/>
	    The CBOR map value representing the value of the claim.
	  </t>

	  <t hangText="CWT Claims Set">
	    <vspace/>
	    The CBOR map that contains the claims conveyed by the CWT.
	  </t>

	</list>
      </t>

    </section>

    <section anchor="Claims" title="Claims">
      <t>
	The set of claims that a CWT must contain to be considered valid is
	context dependent and is outside the scope of this specification.
	Specific applications of CWTs will require implementations to
	understand and process some claims in particular ways.  However, in
	the absence of such requirements, all claims that are not understood
	by implementations MUST be ignored.
      </t>

      <t>
	To keep CWTs as small as possible, the Claim Keys are
	represented using integers or text strings.
	<xref target="CWTCNMajorTypesSummary"/> summarizes all keys
	used to identify the claims defined in this document.
      </t>

      <section anchor="CWTClaimNames" title="Registered Claims">

	 <t>
	   None of the claims defined below are intended to be
	   mandatory to use or implement. They rather provide
	   a starting point for a set of useful, interoperable claims.
	   Applications using CWTs should define which specific claims they
	   use and when they are required or optional.
	 </t>

	 <section anchor="CWTCNiss" title="iss (Issuer) Claim">
	    <t>
	      The <spanx style="verb">iss</spanx> (issuer) claim has the same meaning and
	      processing rules as the <spanx style="verb">iss</spanx> claim defined in Section 4.1.1
	      of <xref target="RFC7519"/>, except that the value is a StringOrURI,
	      as defined in <xref target="Terminology"/> of this specification.
	      The Claim Key 1 is used to identify this claim.
	    </t>
	 </section>

	 <section anchor="CWTCNsub" title="sub (Subject) Claim">
	    <t>
	      The <spanx style="verb">sub</spanx> (subject) claim has the same meaning and
	      processing rules as the <spanx style="verb">sub</spanx> claim defined in Section 4.1.2
	      of <xref target="RFC7519"/>, except that the value is a StringOrURI,
	      as defined in <xref target="Terminology"/> of this specification.
	      The Claim Key 2 is used to identify this claim.
	    </t>
	  </section>

	  <section anchor="CWTCNaud" title="aud (Audience) Claim">
	    <t>
	      The <spanx style="verb">aud</spanx> (audience) claim has the same meaning and
	      processing rules as the <spanx style="verb">aud</spanx> claim defined in Section 4.1.3
	      of <xref target="RFC7519"/>, except that the value of the audience claim
	      is a StringOrURI when it is not an array
	      or each of the audience array element values is a StringOrURI
	      when the audience claim value is an array.
	      (StringOrURI is defined in <xref target="Terminology"/> of this specification.)
	      The Claim Key 3 is used to identify this claim.
	    </t>
	  </section>

	  <section anchor="CWTCNexp" title="exp (Expiration Time) Claim">
	    <t>
	      The <spanx style="verb">exp</spanx> (expiration time) claim has the same meaning
	      and processing rules as the <spanx style="verb">exp</spanx> claim defined in Section
	      4.1.4 of <xref target="RFC7519"/>, except that the value is a NumericDate,
	      as defined in <xref target="Terminology"/> of this specification.
	      The Claim Key 4 is used to identify this claim.
	    </t>
	  </section>

	  <section anchor="CWTCNnbf" title="nbf (Not Before) Claim">
	    <t>
	      The <spanx style="verb">nbf</spanx> (not before) claim has the same meaning
	      and processing rules as the <spanx style="verb">nbf</spanx> claim defined in Section
	      4.1.5 of <xref target="RFC7519"/>, except that the value is a NumericDate,
	      as defined in <xref target="Terminology"/> of this specification.
	      The Claim Key 5 is used to identify this claim.
	    </t>
	  </section>

	  <section anchor="CWTCNiat" title="iat (Issued At) Claim">
	    <t>
	      The <spanx style="verb">iat</spanx> (issued at) claim has the same meaning
	      and processing rules as the <spanx style="verb">iat</spanx> claim defined in Section
	      4.1.6 of <xref target="RFC7519"/>, except that the value is a NumericDate,
	      as defined in <xref target="Terminology"/> of this specification.
	      The Claim Key 6 is used to identify this claim.
	    </t>
	  </section>

	  <section anchor="CWTCNcti" title="cti (CWT ID) Claim">
	    <t>
	      The <spanx style="verb">cti</spanx> (CWT ID) claim has the same meaning
	      and processing rules as the <spanx style="verb">jti</spanx> claim defined in Section
	      4.1.7 of <xref target="RFC7519"/>, except that the value is a byte string.
	      The Claim Key 7 is used to identify this claim.
	    </t>
	  </section>

      </section>

    </section>


    <section anchor="CWTCNMajorTypesSummary"
       title="Summary of the claim names, keys, and value types">
      <texttable title="Summary of the claim names, keys, and value types" anchor="fig:cborMappingValuesAccessTokens">
        <ttcol align='left'>Name</ttcol>
        <ttcol align='left'>Key</ttcol>
        <ttcol align='left'>Value type</ttcol>
        <c>iss</c>
        <c>1</c>
        <c>text string</c>

        <c>sub</c>
        <c>2</c>
        <c>text string</c>

        <c>aud</c>
        <c>3</c>
        <c>text string</c>

        <c>exp</c>
        <c>4</c>
        <c>integer or floating-point number</c>

        <c>nbf</c>
        <c>5</c>
        <c>integer or floating-point number</c>

        <c>iat</c>
        <c>6</c>
        <c>integer or floating-point number</c>

        <c>cti</c>
        <c>7</c>
        <c>byte string </c>
      </texttable>
    </section>

    <section anchor="TaggedValues" title="CBOR Tags and Claim Values">
      <t>
	The claim values defined in this specification MUST NOT be prefixed with
	any CBOR tag.  For instance, while CBOR tag 1 (epoch-based date/time)
	could logically be prefixed to values of the
	<spanx style="verb">exp</spanx>,
	<spanx style="verb">nbf</spanx>, and
	<spanx style="verb">iat</spanx>
	claims, this is unnecessary, since the representation of the claim values
	is already specified by the claim definitions.
	Tagging claim values would only take up extra space without adding information.
	However, this does not prohibit future claim definitions
	from requiring the use of CBOR tags for those specific claims.
      </t>
    </section>

    <section anchor="CWTCBORTag" title="CWT CBOR Tag">
      <t>
	How to determine that a CBOR data structure is a CWT is application-dependent.
	In some cases, this information is known from the application context,
	such as from the position of the CWT in a data structure at which the value must be a CWT.
	One method of indicating that a CBOR object is a CWT is the use of
	the "application/cwt" content type by a transport protocol.
      </t>
      <t>
	This section defines the CWT CBOR tag as another means for applications to
	declare that a CBOR data structure is a CWT.
	Its use is optional and is intended for use in cases in which
	this information would not otherwise be known.
      </t>
      <t>
	If present, the CWT tag MUST prefix a tagged object using one of the COSE CBOR tags.
	In this example, the COSE_Mac0 tag is used.
	The actual COSE_Mac0 object has been excluded from this example.
	<figure align="center" anchor="fig:CWTTagExample"
	    title='Example of a CWT tag usage'>
	    <artwork align="left"><![CDATA[
/ CWT CBOR tag / 61(
  / COSE_Mac0 CBOR tag / 17(
    / COSE_Mac0 object /
  )
)
]]></artwork>
	</figure>
      </t>
    </section>

    <section anchor="CreatingValidatingCWTs" title="Creating and Validating CWTs">

      <section anchor="CreatingCWT" title="Creating a CWT">
	<t>
	  To create a CWT, the following steps are performed.  The order of the
	  steps is not significant in cases where there are no dependencies
	  between the inputs and outputs of the steps.
	</t>
	<t>
	<list style="numbers">
	  <t>
	    Create a CWT Claims Set containing the desired claims.
	  </t>
	  <t>
	    Let the Message be the binary representation of the CWT Claims Set.
	  </t>
	  <t>
	    Create a COSE Header containing the desired set of Header
	    Parameters.  The COSE Header MUST be valid per the
	    <xref target="RFC8152"/> specification.
	  </t>
	  <t>
	    Depending upon whether the CWT is signed, MACed, or encrypted,
	    there are three cases:
	    <list style="symbols">
	      <t>
		If the CWT is signed, create a COSE_Sign/COSE_Sign1 object
		using the Message as the COSE_Sign/COSE_Sign1 Payload; all
		steps specified in <xref target="RFC8152"/> for
		creating a COSE_Sign/COSE_Sign1 object MUST be followed.
	      </t>
	      <t>
		Else, if the CWT is MACed, create a COSE_Mac/COSE_Mac0 object
		using the Message as the COSE_Mac/COSE_Mac0 Payload; all
		steps specified in <xref target="RFC8152"/> for
		creating a COSE_Mac/COSE_Mac0 object MUST be followed.
	      </t>
	      <t>
		Else, if the CWT is a COSE_Encrypt/COSE_Encrypt0 object,
		create a COSE_Encrypt/COSE_Encrypt0 using the Message as
		the plaintext for the COSE_Encrypt/COSE_Encrypt0 object;
		all steps specified in <xref target="RFC8152"/>
		for creating a COSE_Encrypt/COSE_Encrypt0 object MUST be
		followed.
	      </t>
	    </list>
	  </t>
	  <t>
	    If a nested signing, MACing, or encryption operation will be
	    performed, let the Message be the tagged COSE_Sign/COSE_Sign1,
	    COSE_Mac/COSE_Mac0, or COSE_Encrypt/COSE_Encrypt0, and return to Step 3.
	  </t>
	  <t>
	    If needed by the application, prepend the COSE object with the appropriate
      COSE CBOR tag to indicate the type of the COSE object.
	    If needed by the application, prepend the COSE object with the CWT CBOR tag
	    to indicate that the COSE object is a CWT.
	  </t>
	</list>
      </t>
      </section>
      <section anchor="ValidatingCWT" title="Validating a CWT">
	<t>
	  When validating a CWT, the following steps are performed.  The order
	  of the steps is not significant in cases where there are no
	  dependencies between the inputs and outputs of the steps.  If any of
	  the listed steps fail, then the CWT MUST be rejected -- that is,
	  treated by the application as invalid input.
	</t>
	<t>
	  <list style="numbers">
	    <t>
	      Verify that the CWT is a valid CBOR object.
	    </t>
	    <t>
	      If the object begins with the CWT CBOR tag, remove it
	      and verify that one of the COSE CBOR tags follows it.
	    </t>
	    <t>
	      If the object is tagged with one of the COSE CBOR tags, remove it
	      and use it to determine the type of the CWT,
	      COSE_Sign/COSE_Sign1, COSE_Mac/COSE_Mac0, or
	      COSE_Encrypt/COSE_Encrypt0.
	      If the object does not have a COSE CBOR tag, the COSE message
	      type is determined from the application context.
	    </t>
	    <t>
	      Verify that the resulting COSE Header includes only parameters
	      and values whose syntax and semantics are both understood and
	      supported or that are specified as being ignored when not
	      understood.
	    </t>
	    <t>
	      Depending upon whether the CWT is a signed, MACed, or encrypted,
	      there are three cases:
	      <list style="symbols">
		<t>
		  If the CWT is a COSE_Sign/COSE_Sign1, follow the steps
		  specified in <xref target="RFC8152"/> Section 4
		  (Signing Objects) for validating a COSE_Sign/COSE_Sign1
		  object.  Let the Message be the COSE_Sign/COSE_Sign1 payload.
		</t>
		<t>
		  Else, if the CWT is a COSE_Mac/COSE_Mac0, follow the steps
		  specified in <xref target="RFC8152"/> Section 6
		  (MAC Objects) for validating a COSE_Mac/COSE_Mac0 object.
		  Let the Message be the COSE_Mac/COSE_Mac0 payload.
		</t>
		<t>
		  Else, if the CWT is a COSE_Encrypt/COSE_Encrypt0 object,
		  follow the steps specified in
		  <xref target="RFC8152"/> Section 5 (Encryption
		  Objects) for validating a COSE_Encrypt/COSE_Encrypt0 object.
		  Let the Message be the resulting plaintext.
		</t>
	      </list>
	    </t>
	    <t>
	      If the Message begins with a COSE CBOR tag, then
	      the Message is a CWT that was the subject of nested signing, MACing,
	      or encryption operations.  In this case, return to Step 1,
	      using the Message as the CWT.
	    </t>
	    <t>
	      Verify that the Message is a valid CBOR map; let the CWT Claims Set be this CBOR map.
	    </t>
	  </list>
	</t>
      </section>
    </section>

    <section anchor="Security" title="Security Considerations">
      <t>
	The security of the CWT relies upon on the protections offered by COSE.
	Unless the claims in a CWT are protected, an adversary can modify, add, or remove claims.
      </t>
      <t>
	Since the claims conveyed in a CWT may be used to make authorization decisions,
	it is not only important to protect the CWT in transit but also to ensure that
	the recipient can authenticate the party that assembled the claims and created the CWT.
	Without trust of the recipient in the party that created the CWT, no sensible authorization decision can be made.
	Furthermore, the creator of the CWT needs to carefully evaluate each claim value prior to including it in the CWT
	so that the recipient can be assured of the validity of the information provided.
      </t>
      <t>
	While syntactically the signing and encryption operations for Nested
	CWTs may be applied in any order, if both signing and encryption are
	necessary, normally producers should sign the message and then encrypt
	the result (thus encrypting the signature).  This prevents attacks in
	which the signature is stripped, leaving just an encrypted message, as
	well as providing privacy for the signer.  Furthermore, signatures
	over encrypted text are not considered valid in many jurisdictions.
      </t>
    </section>

    <!-- /////////////////////////////////////////////////////////////////////// -->

    <section anchor="IANA" title="IANA Considerations">

      <section anchor="IANACWTClaimsRegistry" title="CBOR Web Token (CWT) Claims Registry">
	<t>
	  This section establishes the
	  IANA "CBOR Web Token (CWT) Claims" registry.
	</t>
	<t>
	  Registration requests are evaluated using the criteria described
	  in the Claim Key instructions in the registration template below
	  after a three-week review period on the cwt-reg-review@ietf.org mailing list,
	  on the advice of one or more Designated Experts.
	  However, to allow for the
	  allocation of values prior to publication, the Designated Experts may approve
	  registration once they are satisfied that such a specification will be published.
	  [[ Note to the RFC Editor:
	  The name of the mailing list should be determined in consultation
	  with the IESG and IANA. Suggested name: cwt-reg-review@ietf.org. ]]
	</t>
	<t>
	  Registration requests sent to the mailing list for review should use
	  an appropriate subject
	  (e.g., "Request to register claim: example").
	  Registration requests that are undetermined for
	  a period longer than 21 days can be brought to the IESG's attention
	  (using the iesg@ietf.org mailing list) for resolution.
	</t>
	<t>
	  Criteria that should be applied by the Designated Experts includes
	  determining whether the proposed registration duplicates existing functionality,
	  whether it is likely to be of general applicability
	  or whether it is useful only for a single application,
	  and whether the registration description is clear.
	  Registrations for the limited set of values between -256 and 255 and strings of length 1
	  are to be restricted to claims with general applicability.
	</t>
        <t>
          IANA must only accept registry updates from the Designated Experts and should direct
          all requests for registration to the review mailing list.
        </t>
	<t>
	  It is suggested that multiple Designated Experts be appointed who are able to
	  represent the perspectives of different applications using this specification
	  in order to enable broadly informed review of registration decisions.
	  In cases where a registration decision could be perceived as
	  creating a conflict of interest for a particular Expert,
	  that Expert should defer to the judgment of the other Experts.
	</t>
	<t>
	  Since a high degree of overlap is expected between the contents of
	  the "CBOR Web Token (CWT) Claims" registry and the "JSON Web Token Claims" registry,
	  overlap in the corresponding pools of Designated Experts would be useful
	  to help ensure that an appropriate level of coordination between the registries is maintained.
	</t>

	<section anchor="IANACWTClaimsKeyRegistryTemplate" title="Registration Template">
	  <t>
	    <list style='hanging'>
	      <t hangText='Claim Name:'>
		<vspace/>
		The human-readable name requested (e.g., "iss").
	      </t>
	      <t hangText='Claim Description:'>
		<vspace/>
		Brief description of the claim (e.g., "Issuer").
	      </t>
	      <t hangText='JWT Claim Name:'>
		<vspace/>
		Claim Name of the equivalent JWT claim, as registered in <xref target="IANA.JWT.Claims"/>.
		CWT claims should normally have a corresponding JWT claim.
		If a corresponding JWT claim would not make sense,
		the Designated Experts can choose to accept registrations
		for which the JWT Claim Name is listed as "N/A".
	      </t>
	      <t hangText='Claim Key:'>
		<vspace/>
		CBOR map key for the claim.
		Different ranges of values use different registration policies <xref target="RFC8126"/>.
		Integer values from -256 to 255 and strings of length 1 are designated
		as Standards Action. Integer values from -65536 to -257 and from 256 to 65535
		and strings of length 2 are designated as Specification Required. Integer
		values greater than 65535 and strings of length greater than 2 are
		designated as Expert Review. Integer values less than -65536 are marked
		as Private Use.
	      </t>
	      <t hangText='Claim Value Type(s):'>
		<vspace/>
		CBOR types that can be used for the claim value.
	      </t>
	      <t hangText='Change Controller:'>
		<vspace/>
		For Standards Track RFCs, list the "IESG". For others, give the name of the responsible party. Other details (e.g., postal address, email address, home page URI) may also be included.
	      </t>
	      <t hangText='Specification Document(s):'>
		<vspace/>
		Reference to the document or documents that specify the parameter, preferably including URIs that can be used to retrieve copies of the documents. An indication of the relevant sections may also be included but is not required.
	      </t>
	    </list>
	  </t>
	</section>

	<section anchor="IANACWTClaimsKeyRegistryInitial" title="Initial Registry Contents">
	  <t>
	    <?rfc subcompact="yes"?>
	    <list style='symbols'>
	      <t>Claim Name: (RESERVED)</t>
	      <t>Claim Description: This registration reserves the key value 0.</t>
	      <t>JWT Claim Name: N/A</t>
	      <t>Claim Key: 0</t>
	      <t>Claim Value Type(s): N/A</t>
	      <t>Change Controller: IESG</t>
	      <t>Specification Document(s): [[ this specification ]]</t>
	    </list>
	  </t>
	  <t>
	    <list style='symbols'>
	      <t>Claim Name: <spanx style="verb">iss</spanx></t>
	      <t>Claim Description: Issuer</t>
	      <t>JWT Claim Name: <spanx style="verb">iss</spanx></t>
	      <t>Claim Key: 1</t>
	      <t>Claim Value Type(s): text string</t>
	      <t>Change Controller: IESG</t>
	      <t>Specification Document(s): <xref target="CWTCNiss"/> of [[ this specification ]]</t>
	    </list>
	  </t>
	  <t>
	    <list style='symbols'>
	      <t>Claim Name: <spanx style="verb">sub</spanx></t>
	      <t>Claim Description: Subject</t>
	      <t>JWT Claim Name: <spanx style="verb">sub</spanx></t>
	      <t>Claim Key: 2</t>
	      <t>Claim Value Type(s): text string</t>
	      <t>Change Controller: IESG</t>
	      <t>Specification Document(s): <xref target="CWTCNsub"/> of [[ this specification ]]</t>
	    </list>
	  </t>
	  <t>
	    <list style='symbols'>
	      <t>Claim Name: <spanx style="verb">aud</spanx></t>
	      <t>Claim Description: Audience</t>
	      <t>JWT Claim Name: <spanx style="verb">aud</spanx></t>
	      <t>Claim Key: 3</t>
	      <t>Claim Value Type(s): text string</t>
	      <t>Change Controller: IESG</t>
	      <t>Specification Document(s): <xref target="CWTCNaud"/> of [[ this specification ]]</t>
	    </list>
	  </t>
	  <t>
	    <list style='symbols'>
	      <t>Claim Name: <spanx style="verb">exp</spanx></t>
	      <t>Claim Description: Expiration Time</t>
	      <t>JWT Claim Name: <spanx style="verb">exp</spanx></t>
	      <t>Claim Key: 4</t>
	      <t>Claim Value Type(s): integer or floating-point number</t>
	      <t>Change Controller: IESG</t>
	      <t>Specification Document(s): <xref target="CWTCNexp"/> of [[ this specification ]]</t>
	    </list>
	  </t>
	  <t>
	    <list style='symbols'>
	      <t>Claim Name: <spanx style="verb">nbf</spanx></t>
	      <t>Claim Description: Not Before</t>
	      <t>JWT Claim Name: <spanx style="verb">nbf</spanx></t>
	      <t>Claim Key: 5</t>
	      <t>Claim Value Type(s): integer or floating-point number</t>
	      <t>Change Controller: IESG</t>
	      <t>Specification Document(s): <xref target="CWTCNnbf"/> of [[ this specification ]]</t>
	    </list>
	  </t>
	  <t>
	    <list style='symbols'>
	      <t>Claim Name: <spanx style="verb">iat</spanx></t>
	      <t>Claim Description: Issued At</t>
	      <t>JWT Claim Name: <spanx style="verb">iat</spanx></t>
	      <t>Claim Key: 6</t>
	      <t>Claim Value Type(s): integer or floating-point number</t>
	      <t>Change Controller: IESG</t>
	      <t>Specification Document(s): <xref target="CWTCNiat"/> of [[ this specification ]]</t>
	    </list>
	  </t>
	  <t>
	    <list style='symbols'>
	      <t>Claim Name: <spanx style="verb">cti</spanx></t>
	      <t>Claim Description: CWT ID</t>
	      <t>JWT Claim Name: <spanx style="verb">jti</spanx></t>
	      <t>Claim Key: 7</t>
	      <t>Claim Value Type(s): byte string</t>
	      <t>Change Controller: IESG</t>
	      <t>Specification Document(s): <xref target="CWTCNcti"/> of [[ this specification ]]</t>
	    </list>
	  </t>

	</section>
	<?rfc subcompact="no"?>

      </section>


      <section title="Media Type Registration" anchor="MediaReg">
	<t>
	  This section registers the <spanx
	  style="verb">application/cwt</spanx> media type
	  in the "Media Types" registry <xref target="IANA.MediaTypes"/>
	  in the manner described in <xref target="RFC6838">RFC 6838</xref>,
	  which can be used to indicate that the content is a CWT.
	</t>
	<section title="Registry Contents" anchor="MediaContents">
	  <t> <?rfc subcompact="yes"?>
	    <list style="symbols">
	      <t>
		Type name: application
	      </t>
	      <t>
		Subtype name: cwt
	      </t>
	      <t>
		Required parameters: N/A
	      </t>
	      <t>
		Optional parameters: N/A
	      </t>
	      <t>
		Encoding considerations: binary
	      </t>
	      <t>
		Security considerations: See the Security Considerations section of [[ this specification ]]
	      </t>
	      <t>
		Interoperability considerations: N/A
	      </t>
	      <t>
		Published specification: [[ this specification ]]
	      </t>
	      <t>
		Applications that use this media type:
		IoT applications sending security tokens over HTTP(S), CoAP(S), and other transports.
	      </t>
	      <t>
		Fragment identifier considerations: N/A
	      </t>
	      <t>
		Additional information:<list style="empty">
		<t>Magic number(s): N/A</t>
		<t>File extension(s): N/A</t>
		<t>Macintosh file type code(s): N/A </t></list>
<vspace/>
	      </t>
	      <t>
		Person &amp; email address to contact for further information:
<vspace/>
		IESG, iesg@ietf.org
	      </t>
	      <t>
		Intended usage: COMMON
	      </t>
	      <t>
		Restrictions on usage: none
	      </t>
	      <t>
		Author: Michael B.&nbsp;Jones, mbj@microsoft.com
	      </t>
	      <t>
		Change controller: IESG
	      </t>
	      <t>
		Provisional registration? No
	      </t>
	    </list>
	  </t>
	</section>
	<?rfc subcompact="no"?>
      </section>

      <section anchor="IANACoAPContentFormatRegistration" title="CoAP Content-Formats Registration">
	<t>
	  This section registers the CoAP Content-Format ID for the "application/cwt" media type
	  in the "CoAP Content-Formats" registry <xref target="IANA.CoAP.Content-Formats"/>.
	</t>

	<section anchor="CoAPreg" title="Registry Contents">
	  <t>
	    <?rfc subcompact="yes"?>
	    <list style='symbols'>
	      <t>Media Type: application/cwt</t>
	      <t>Encoding: - </t>
	      <t>Id: TBD (maybe 61) </t>
	      <t>Reference: [[ this specification ]]</t>
	    </list>
	  </t>
	</section>
	<?rfc subcompact="no"?>
      </section>

      <section anchor="IANACBORTagAssignment" title="CBOR Tag registration">
	<t>
	  This section registers the CWT CBOR tag
	  in the "CBOR Tags" registry <xref target="IANA.CBOR.Tags"/>.
	</t>

	<section anchor="CBORTagReg" title="Registry Contents">
	  <t>
	    <?rfc subcompact="yes"?>
	    <list style='symbols'>
	      <t>CBOR Tag: TBD (maybe 61 to use the same value as the Content-Format)</t>
	      <t>Data Item: CBOR Web Token (CWT)</t>
	      <t>Semantics: CBOR Web Token (CWT), as defined in [[ this specification ]]</t>
	      <t>Description of Semantics: [[ this specification ]]</t>
	      <t>Point of Contact: Michael B. Jones, mbj@microsoft.com</t>
	    </list>
	  </t>
	</section>
	<?rfc subcompact="no"?>
      </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.7049.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.8152.xml' ?>
      <?rfc include='http://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.8174.xml' ?>

      <reference anchor="IANA.MediaTypes" target="http://www.iana.org/assignments/media-types">
	<front>
	  <title>Media Types</title>
	  <author>
	    <organization>IANA</organization>
	  </author>
	  <date/>
	</front>
      </reference>

      <reference anchor="IANA.CoAP.Content-Formats" target="http://www.iana.org/assignments/core-parameters/core-parameters.xhtml#content-formats">
	<front>
	  <title>CoAP Content-Formats</title>
	  <author>
	    <organization>IANA</organization>
	  </author>
	  <date/>
	</front>
      </reference>

      <reference anchor="IANA.CBOR.Tags" target="http://www.iana.org/assignments/cbor-tags/cbor-tags.xhtml">
	<front>
	  <title>Concise Binary Object Representation (CBOR) Tags</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.6838.xml' ?>
      <?rfc include='http://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.7515.xml' ?>
      <?rfc include='http://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.7516.xml' ?>
      <?rfc include='http://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.8126.xml' ?>

      <reference anchor="IANA.JWT.Claims" target="http://www.iana.org/assignments/jwt">
	<front>
	  <title>JSON Web Token Claims</title>
	  <author>
	    <organization>IANA</organization>
	  </author>
	  <date/>
	</front>
      </reference>

    </references>

    <section anchor="Examples" title="Examples">
      <t>
	This appendix includes a set of CWT examples that show how the CWT Claims Set can be protected.
	There are examples that are signed, MACed, encrypted, and that use nested signing and encryption.
	To make the examples easier to read, they are presented both as hex strings and
	in the extended CBOR diagnostic notation described in Section 6 of <xref target="RFC7049"/>.
      </t>
      <t>
        Where a byte string is to carry an embedded CBOR-encoded item, the
        diagnostic notation for this CBOR data item can be enclosed
        in '&lt;&lt;' and '&gt;&gt;' to notate the byte string resulting from encoding the
        data item, e.g., h'63666F6F' translates to &lt;&lt;"foo"&gt;&gt;.
      </t>

      <section anchor="exampleClaimsSet" title='Example CWT Claims Set'>
	<t>
	  The CWT Claims Set used for the different examples
	  displays usage of all the defined claims. For signed and MACed
	  examples, the CWT Claims Set is the CBOR encoding as a byte string.
	</t>
	<t>
	  <figure align="center" anchor="fig:exampleClaimsSetHex"
		  title='Example CWT Claims Set as hex string'>
	    <artwork align="left"><![CDATA[
a70175636f61703a2f2f61732e6578616d706c652e636f6d02656572696b7703
7818636f61703a2f2f6c696768742e6578616d706c652e636f6d041a5612aeb0
051a5610d9f0061a5610d9f007420b71
]]></artwork>
	  </figure>
	</t>
	<t>
	  <figure align="center" anchor="fig:exampleClaimsSetDiagnostic"
	      title='Example CWT Claims Set in CBOR diagnostic notation'>
	    <artwork align="left"><![CDATA[
{
  / iss / 1: "coap://as.example.com",
  / sub / 2: "erikw",
  / aud / 3: "coap://light.example.com",
  / exp / 4: 1444064944,
  / nbf / 5: 1443944944,
  / iat / 6: 1443944944,
  / cti / 7: h'0b71'
}
]]></artwork>
	  </figure>
	</t>
      </section>

      <section anchor="exampleKeys" title='Example keys'>
	<t>
	  This section contains the keys used to sign, MAC, and encrypt the messages in this appendix.
	  Line breaks are for display purposes only.
	</t>

	<section anchor="exampleKeysSymmetric128" title='128-bit Symmetric Key'>
    <figure align="center" anchor="fig:exampleKeysShared128Hex"
title='128-bit symmetric COSE_Key as hex string'><artwork align="left"><![CDATA[
a42050231f4c4d4d3051fdc2ec0a3851d5b3830104024c53796d6d6574726963
313238030a
]]></artwork></figure>
<figure align="center" anchor="fig:exampleKeysShared128Diag"
title='128-bit symmetric COSE_Key in CBOR diagnostic notation'><artwork align="left"><![CDATA[
{
  / k /   -1: h'231f4c4d4d3051fdc2ec0a3851d5b383'
  / kty /  1: 4 / Symmetric /,
  / kid /  2: h'53796d6d6574726963313238' / 'Symmetric128' /,
  / alg /  3: 10 / AES-CCM-16-64-128 /
}
]]></artwork></figure>
	</section>

	<section anchor="exampleKeysSymmetric256" title='256-bit Symmetric Key'>
	  <figure align="center" anchor="fig:exampleKeysShared256Hex"
	  title='256-bit symmetric COSE_Key as hex string'><artwork align="left"><![CDATA[
a4205820403697de87af64611c1d32a05dab0fe1fcb715a86ab435f1ec99192d
795693880104024c53796d6d6574726963323536030a
]]></artwork></figure>
    <figure align="center" anchor="fig:exampleKeysShared256Diag"
title='256-bit symmetric COSE_Key in CBOR diagnostic notation'><artwork align="left"><![CDATA[
{
  / k /   -1: h'403697de87af64611c1d32a05dab0fe1fcb715a86ab435f1
                ec99192d79569388'
  / kty /  1: 4 / Symmetric /,
  / kid /  4: h'53796d6d6574726963323536' / 'Symmetric256' /,
  / alg /  3: 4 / HMAC 256/64 /
}
]]></artwork></figure>
	</section>

	<section anchor="exampleKeysECDSA256" title='ECDSA P-256 256-bit COSE Key'>
    <t>
    <figure align="center" anchor="fig:exampleKeysECDSA256"
	  title='ECDSA 256-bit COSE Key as hex string'>
      <artwork align="left"><![CDATA[
a72358206c1382765aec5358f117733d281c1c7bdc39884d04a45a1e6c67c858
bc206c1922582060f7f1a780d8a783bfb7a2dd6b2796e8128dbbcef9d3d168db
9529971a36e7b9215820143329cce7868e416927599cf65a34f3ce2ffda55a7e
ca69ed8919a394d42f0f2001010202524173796d6d6574726963454344534132
35360326
]]></artwork>
	  </figure>
	</t>
	<t>
	  <figure align="center" anchor="fig:exampleKeysECDSA256CBORDiagnostic"
		title='ECDSA 256-bit COSE Key in CBOR diagnostic notation'>
	    <artwork align="left"><![CDATA[
{
  / d /   -4: h'6c1382765aec5358f117733d281c1c7bdc39884d04a45a1e
                6c67c858bc206c19',
  / y /   -3: h'60f7f1a780d8a783bfb7a2dd6b2796e8128dbbcef9d3d168
                db9529971a36e7b9',
  / x /   -2: h'143329cce7868e416927599cf65a34f3ce2ffda55a7eca69
                ed8919a394d42f0f',
  / crv / -1: 1 / P-256 /,
  / kty /  1: 2 / EC2 /,
  / kid /  2: h'4173796d6d657472696345434453413
                23536' / 'AsymmetricECDSA256' /,
  / alg /  3: -7 / ECDSA 256 /
}
]]></artwork>
	  </figure>
	</t>
	</section>
      </section>

      <section anchor="exampleSigned" title='Example Signed CWT'>
	<t>
	  This section shows a signed CWT with a single recipient and a full CWT Claims Set.
	</t>
	<t>
	  The signature is generated using the private key listed in <xref target="exampleKeysECDSA256"/>
	  and it can be validated using the public key from <xref target="exampleKeysECDSA256"/>.
	  Line breaks are for display purposes only.
	</t>
	<t>
	  <figure align="center" anchor="fig:exampleSignedHex"
		title='Signed CWT as hex string'>
	    <artwork><![CDATA[
d28443a10126a104524173796d6d657472696345434453413235365850a701756
36f61703a2f2f61732e6578616d706c652e636f6d02656572696b77037818636f
61703a2f2f6c696768742e6578616d706c652e636f6d041a5612aeb0051a5610d
9f0061a5610d9f007420b7158405427c1ff28d23fbad1f29c4c7c6a555e601d6f
a29f9179bc3d7438bacaca5acd08c8d4d4f96131680c429a01f85951ecee743a5
2b9b63632c57209120e1c9e30
]]></artwork>
	  </figure>
	</t>
	<t>
	  <figure align="center" anchor="fig:exampleSignedCBORDiagnostic"
		title='Signed CWT in CBOR diagnostic notation'>
	    <artwork><![CDATA[
18(
  [
    / protected / << {
      / alg / 1: -7 / ECDSA 256 /
    } >>,
    / unprotected / {
      / kid / 4: h'4173796d6d657472696345434453413
                   23536' / 'AsymmetricECDSA256' /
    },
    / payload / << {
      / iss / 1: "coap://as.example.com",
      / sub / 2: "erikw",
      / aud / 3: "coap://light.example.com",
      / exp / 4: 1444064944,
      / nbf / 5: 1443944944,
      / iat / 6: 1443944944,
      / cti / 7: h'0b71'
    } >>,
    / signature / h'5427c1ff28d23fbad1f29c4c7c6a555e601d6fa29f
                    9179bc3d7438bacaca5acd08c8d4d4f96131680c42
                    9a01f85951ecee743a52b9b63632c57209120e1c9e
                    30'
  ]
)
]]></artwork>
	  </figure>
	</t>
      </section>

      <section anchor="exampleMACed" title='Example MACed CWT'>
	<t>
	  This section shows a MACed CWT with a single recipient, a full CWT Claims Set,
	  and a CWT tag.
	</t>
	<t>
	  The MAC is generated using the 256-bit symmetric key from <xref target="exampleKeysSymmetric256"/> with a 64-bit truncation.
	  Line breaks are for display purposes only.
	</t>
	<t>
	  <figure align="center" anchor="fig:exampleMACedHex"
		title='MACed CWT with CWT tag as hex string'>
	    <artwork><![CDATA[
d83dd18443a10104a1044c53796d6d65747269633235365850a70175636f6170
3a2f2f61732e6578616d706c652e636f6d02656572696b77037818636f61703a
2f2f6c696768742e6578616d706c652e636f6d041a5612aeb0051a5610d9f006
1a5610d9f007420b7148093101ef6d789200
]]></artwork>
	  </figure>
	</t>
	<t>
	  <figure align="center" anchor="fig:exampleMACedCBORDiagnostic"
		title='MACed CWT with CWT tag in CBOR diagnostic notation'>
	    <artwork><![CDATA[
61(
  17(
    [
      / protected / << {
        / alg / 1: 4 / HMAC-256-64 /
      } >>,
      / unprotected / {
        / kid / 4: h'53796d6d6574726963323536' / 'Symmetric256' /
      },
      / payload / << {
        / iss / 1: "coap://as.example.com",
        / sub / 2: "erikw",
        / aud / 3: "coap://light.example.com",
        / exp / 4: 1444064944,
        / nbf / 5: 1443944944,
        / iat / 6: 1443944944,
        / cti / 7: h'0b71'
      } >>,
      / tag / h'093101ef6d789200'
    ]
  )
)
]]></artwork>
	  </figure>
	</t>
      </section>
      <section anchor="exampleEncrypted" title='Example Encrypted CWT'>
	<t>
	  This section shows an encrypted CWT with a single recipient and a full CWT Claims Set.
	</t>
	<t>
	  The encryption is done with AES-CCM mode using the 128-bit symmetric key from <xref target="exampleKeysSymmetric128"/> with a 64-bit tag and 13-byte nonce, i.e., COSE AES-CCM-16-64-128.
	  Line breaks are for display purposes only.
	</t>
	<t>
	  <figure align="center" anchor="fig:exampleEncryptedHex" title='Encrypted CWT as hex string'>
	    <artwork><![CDATA[
d08343a1010aa2044c53796d6d6574726963313238054d99a0d7846e762c49ff
e8a63e0b5858b918a11fd81e438b7f973d9e2e119bcb22424ba0f38a80f27562
f400ee1d0d6c0fdb559c02421fd384fc2ebe22d7071378b0ea7428fff157444d
45f7e6afcda1aae5f6495830c58627087fc5b4974f319a8707a635dd643b
]]></artwork>
	  </figure>
	</t>
	<t>
	  <figure align="center" anchor="fig:exampleEncryptedCBORDiagnostic"
		title='Encrypted CWT in CBOR diagnostic notation'>
	    <artwork><![CDATA[
16(
  [
    / protected / << {
      / alg / 1: 10 / AES-CCM-16-64-128 /
    } >>,
    / unprotected / {
      / kid / 4: h'53796d6d6574726963313238' / 'Symmetric128' /,
      / iv /  5: h'99a0d7846e762c49ffe8a63e0b'
    },
    / ciphertext / h'b918a11fd81e438b7f973d9e2e119bcb22424ba0f38
                     a80f27562f400ee1d0d6c0fdb559c02421fd384fc2e
                     be22d7071378b0ea7428fff157444d45f7e6afcda1a
                     ae5f6495830c58627087fc5b4974f319a8707a635dd
                     643b'
  ]
)
]]></artwork>
	  </figure>
	</t>
      </section>
      <section anchor="exampleNested" title='Example Nested CWT'>

	<t>
	  This section shows a Nested CWT, signed and then encrypted, with a single recipient and a full CWT Claims Set.
	</t>
	<t>
	  The signature is generated using the private ECDSA key from <xref target="exampleKeysECDSA256"/>
	  and it can be validated using the public ECDSA parts from <xref target="exampleKeysECDSA256"/>.
	  The encryption is done with AES-CCM mode using the 128-bit symmetric key from <xref target="exampleKeysSymmetric128"/>
    with a 64-bit tag and 13-byte nonce, i.e., COSE AES-CCM-16-64-128.
    The content type is set to CWT to indicate that there are multiple
    layers of COSE protection before finding the CWT Claims Set. The decrypted
    ciphertext will be a COSE_sign1 structure.  In this example, it is the same
    one as in <xref target="exampleSigned"/>, i.e., a Signed CWT Claims Set.
    Note that there is no limitation to the number of layers; this is an
    example with two layers.
	  Line breaks are for display purposes only.
	</t>
	<t>
	  <figure align="center" anchor="fig:exampleNestedHex"
		title='Signed and Encrypted CWT as hex string'>
	    <artwork><![CDATA[
d08343a1010aa2044c53796d6d6574726963313238054d4a0694c0e69ee6b595
6655c7b258b7f6b0914f993de822cc47e5e57a188d7960b528a747446fe12f0e
7de05650dec74724366763f167a29c002dfd15b34d8993391cf49bc91127f545
dba8703d66f5b7f1ae91237503d371e6333df9708d78c4fb8a8386c8ff09dc49
af768b23179deab78d96490a66d5724fb33900c60799d9872fac6da3bdb89043
d67c2a05414ce331b5b8f1ed8ff7138f45905db2c4d5bc8045ab372bff142631
610a7e0f677b7e9b0bc73adefdcee16d9d5d284c616abeab5d8c291ce0
]]></artwork>
	  </figure>
	</t>
	<t>
	  <figure align="center" anchor="fig:exampleNestedCBORDiagnostic"
		title='Signed and Encrypted CWT in CBOR diagnostic notation'>
	    <artwork><![CDATA[
16(
  [
    / protected / << {
      / alg / 1: 10 / AES-CCM-16-64-128 /
    } >>,
    / unprotected / {
      / kid / 4: h'53796d6d6574726963313238' / 'Symmetric128' /,
      / iv /  5: h'4a0694c0e69ee6b5956655c7b2'
    },
    / ciphertext / h'f6b0914f993de822cc47e5e57a188d7960b528a7474
                     46fe12f0e7de05650dec74724366763f167a29c002d
                     fd15b34d8993391cf49bc91127f545dba8703d66f5b
                     7f1ae91237503d371e6333df9708d78c4fb8a8386c8
                     ff09dc49af768b23179deab78d96490a66d5724fb33
                     900c60799d9872fac6da3bdb89043d67c2a05414ce3
                     31b5b8f1ed8ff7138f45905db2c4d5bc8045ab372bf
                     f142631610a7e0f677b7e9b0bc73adefdcee16d9d5d
                     284c616abeab5d8c291ce0'
  ]
)
]]></artwork>
	  </figure>
	</t>
      </section>
      <section anchor="exampleMACedFloat" title='Example MACed CWT with a floating-point value'>
	<t>
	  This section shows a MACed CWT with a single recipient and a simple
	  CWT Claims Set. The CWT Claims Set with a floating-point 'iat' value.
      	</t>
	<t>
      	  The MAC is generated using the 256-bit symmetric key from
	  <xref target="exampleKeysSymmetric256"/> with a 64-bit truncation.
      	  Line breaks are for display purposes only.
      	</t>
	<t>
	  <figure align="center" anchor="fig:exampleMACedFloatHex"
		  title='MACed CWT with a floating-point value as hex string'>
	    <artwork><![CDATA[
d18443a10104a1044c53796d6d65747269633235364ba106fb41d584367c2000
0048b8816f34c0542892
]]></artwork>
	  </figure>
	</t>
	<t>
	  <figure align="center" anchor="fig:exampleMACedFloatCBORDiagnostic"
		  title='MACed CWT with a floating-point value in CBOR diagnostic notation'>
	    <artwork><![CDATA[
17(
  [
    / protected / << {
      / alg / 1: 4 / HMAC-256-64 /
    } >>,
    / unprotected / {
      / kid / 4: h'53796d6d6574726963323536' / 'Symmetric256' /,
    },
    / payload / << {
      / iat / 6: 1443944944.5
    } >>,
    / tag / h'b8816f34c0542892'
  ]
)
]]></artwork>
	  </figure>
	</t>
      </section>

    </section>

    <section anchor="Acknowledgements" title="Acknowledgements">
      <t>
	This specification is based on JSON Web Token (JWT) <xref target="RFC7519"/>,
	the authors of which also include Nat Sakimura and John Bradley.
	It also incorporates suggestions made by many people, including
	Carsten Bormann,
	Alissa Cooper,
	Esko Dijk,
	Benjamin Kaduk,
	Warren Kumari,
	Carlos Martinez,
	Alexey Melnikov,
	Kathleen Moriarty,
	Eric Rescorla,
	Dan Romascanu,
	Adam Roach,
	Kyle Rose,
	Jim Schaad,
	Ludwig Seitz,
	and
	Göran Selander.
      </t>
      <t>
	[[ RFC Editor:  Is it possible to preserve the non-ASCII spellings of the names
	Erik Wahlström and Göran Selander in the final specification? ]]
      </t>
    </section>

    <section anchor="History" title="Document History">
      <t>[[ to be removed by the RFC Editor before publication as an RFC ]]</t>
      <t>
        -15
        <list style="symbols">
	  <t>
	    Added section references when the terms "NumericDate" and "StringOrURI" are used,
	    as suggested by Adam Roach.
	  </t>
        </list>
      </t>
      <t>
        -14
        <list style="symbols">
	  <t>
	    Cleaned up the descriptions of the numeric ranges of claim keys being registered
	    in the registration template for the "CBOR Web Token (CWT) Claims" registry,
	    as suggested by Adam Roach.
	  </t>
	  <t>
	    Clarified the relationships between the JWT and CWT "NumericDate" and "StringOrURI" terms,
	    as suggested by Adam Roach.
	  </t>
	  <t>
	    Eliminated unnecessary uses of the word "type",
	    as suggested by Adam Roach.
	  </t>
	  <t>
	    Added the text "IANA must only accept registry updates from the Designated Experts and should direct
	    all requests for registration to the review mailing list" from RFC 7519, as suggested by Amanda Baber of IANA,
	    which is also intended to address Alexey Melnikov's comment.
	  </t>
	  <t>
	    Removed a superfluous comma, as suggested by Warren Kumari.
	  </t>
          <t>
	    Acknowledged additional reviewers.
	  </t>
        </list>
      </t>
      <t>
        -13
        <list style="symbols">
	  <t>
	    Clarified the registration criteria applied to different ranges of Claim Key values,
	    as suggested by Kathleen Moriarty and Dan Romascanu.
	  </t>
	  <t>
	    No longer describe the syntax of CWT claims as being the same as
	    that of the corresponding JWT claims, as suggested by Kyle Rose.
	  </t>
	  <t>
	    Added guidance about the selection of the Designated Experts, as suggested by Benjamin Kaduk.
	  </t>
          <t>
	    Acknowledged additional reviewers.
	  </t>
        </list>
      </t>
      <t>
        -12
        <list style="symbols">
          <t>
	    Updated the RFC 5226 reference to RFC 8126.
	  </t>
	  <t>
	    Made the IANA registration criteria consistent across sections.
	  </t>
	  <t>
	    Stated that registrations for the limited set of values between -256 and 255 and strings of length 1
	    are to be restricted to claims with general applicability.
	  </t>
	  <t>
	    Changed the "Reference" field name to "Description of Semantics" in the CBOR Tag registration request.
	  </t>
	  <t>
	    Asked the RFC Editor whether it is possible to preserve the non-ASCII spellings of the names
	    Erik Wahlström and Göran Selander in the final specification.
	  </t>
        </list>
      </t>
      <t>
        -11
        <list style="symbols">
          <t>
	    Corrected the "iv" value in the signed and encrypted CWT example.
	  </t>
	  <t>
	    Mention CoAP in the <spanx style="verb">application/cwt</spanx> media type registration.
	  </t>
	  <t>
	    Changed references of the form "Section 4.1.1 of JWT &lt;xref target="RFC7519"/&gt;"
	    to "Section 4.1.1 of &lt;xref target="RFC7519"/&gt;" so that rfcmarkup will generate
	    correct external section reference links.
	  </t>
	  <t>
	    Updated Acknowledgements.
	  </t>
        </list>
      </t>
      <t>
        -10
        <list style="symbols">
          <t>
	    Clarified that the audience claim value can be a single audience value or
	    an array of audience values, just as is the case for the JWT "aud" claim.
          </t>
	  <t>
	    Clarified the nested CWT description.
	  </t>
	  <t>
	    Changed uses of "binary string" to "byte string".
	  </t>
        </list>
      </t>
      <t>
        -09
        <list style="symbols">
          <t>
	    Added key ID values to the examples.
          </t>
          <t>
	    Key values for the examples are now represented in COSE_Key format
	    using CBOR diagnostic notation.
          </t>
        </list>
      </t>
      <t>
        -08
        <list style="symbols">
          <t>
	    Updated the diagnostic notation for embedded objects in the examples,
            addressing feedback by Carsten Bormann.
          </t>
        </list>
      </t>
      <t>
        -07
        <list style="symbols">
          <t>
            Updated examples for signing and encryption. Signatures are now
            deterministic as recommended by COSE specification.
          </t>
        </list>
      </t>
      <t>
	-06
	<list style="symbols">
	  <t>
	    Addressed review comments by Carsten Bormann and Jim Schaad.
	    All changes were editorial in nature.
	  </t>
	</list>
      </t>

      <t>
	-05
	<list style="symbols">
	  <t>
	    Addressed working group last call comments with the following changes:
	  </t>
	  <t>
	    Say that CWT is derived from JWT, rather than CWT is a profile of JWT.
	  </t>
	  <t>
	    Used CBOR type names in descriptions, rather than major/minor type numbers.
	  </t>
	  <t>
	    Clarified the NumericDate and StringOrURI descriptions.
	  </t>
	  <t>
	    Changed to allow CWT claim names to use values of any legal CBOR map key type.
	  </t>
	  <t>
	    Changed to use the CWT tag to identify nested CWTs instead of the CWT content type.
	  </t>
	  <t>
	    Added an example using a floating-point date value.
	  </t>
	  <t>
	    Acknowledged reviewers.
	  </t>
	</list>
      </t>

      <t>
	-04
	<list style="symbols">
	  <t>
	    Specified that the use of CBOR tags to prefix any of the claim values defined in this specification is NOT RECOMMENDED.
	  </t>
	</list>
      </t>

      <t>
	-03
	<list style="symbols">
	  <t>
	    Reworked the examples to include signed, MACed, encrypted, and nested CWTs.
	  </t>
	  <t>
	    Defined the CWT CBOR tag and explained its usage.
	  </t>
	</list>
      </t>

      <t>
	-02
	<list style="symbols">
	  <t>
	    Added IANA registration for the application/cwt media type.
	  </t>
	  <t>
	    Clarified the nested CWT language.
	  </t>
	  <t>
	    Corrected nits identified by Ludwig Seitz.
	  </t>
	</list>
      </t>

      <t>
	-01
	<list style="symbols">
	  <t>
	    Added IANA registration for CWT Claims.
	  </t>
	  <t>
	    Added IANA registration for the application/cwt CoAP content-format type.
	  </t>
	  <t>
	    Added Samuel Erdtman as an editor.
	  </t>
	  <t>
	    Changed Erik's e-mail address.
	  </t>
	</list>
      </t>

      <t>
	-00
	<list style="symbols">
	  <t>
	    Created the initial working group version based on draft-wahlstroem-ace-cbor-web-token-00.
	  </t>
	</list>
      </t>

    </section>
  </back>
</rfc>
