<?xml version='1.0' encoding='utf-8'?>
<rfc xmlns:xi="http://www.w3.org/2001/XInclude" version="3" category="std" consensus="true" docName="draft-ietf-cose-countersign-10" indexInclude="true" ipr="trust200902" number="9338" prepTime="2022-12-14T09:29:49" scripts="Common,Latin" sortRefs="true" submissionType="IETF" symRefs="true" tocDepth="3" tocInclude="true" updates="9052" xml:lang="en">
  <link href="https://datatracker.ietf.org/doc/draft-ietf-cose-countersign-10" rel="prev"/>
  <link href="https://dx.doi.org/10.17487/rfc9338" rel="alternate"/>
  <link href="urn:issn:2070-1721" rel="alternate"/>
  <front>
    <title abbrev="COSE Countersignatures">CBOR Object Signing and Encryption (COSE): Countersignatures</title>
    <seriesInfo name="RFC" value="9338" stream="IETF"/>
    <seriesInfo name="STD" value="96" stream="IETF"/>
    <author initials="J." surname="Schaad" fullname="Jim Schaad">
      <organization showOnFrontPage="true">August Cellars</organization>
      <address>
        <postal>
          <country>United States of America</country>
        </postal>
        <email/>
      </address>
    </author>
    <date month="12" year="2022"/>
    <area>sec</area>
    <workgroup>cose</workgroup>
    <keyword>digital signature</keyword>
    <abstract pn="section-abstract">
      <t indent="0" pn="section-abstract-1">
        Concise Binary Object Representation (CBOR) is a data format designed for small code size and small message size.
        CBOR Object Signing and Encryption (COSE) defines a set of security services for CBOR.
        This document defines a countersignature algorithm along with the needed header parameters and CBOR tags for COSE.
        This document updates RFC 9052.
      </t>
    </abstract>
    <boilerplate>
      <section anchor="status-of-memo" numbered="false" removeInRFC="false" toc="exclude" pn="section-boilerplate.1">
        <name slugifiedName="name-status-of-this-memo">Status of This Memo</name>
        <t indent="0" pn="section-boilerplate.1-1">
            This is an Internet Standards Track document.
        </t>
        <t indent="0" pn="section-boilerplate.1-2">
            This document is a product of the Internet Engineering Task Force
            (IETF).  It represents the consensus of the IETF community.  It has
            received public review and has been approved for publication by
            the Internet Engineering Steering Group (IESG).  Further
            information on Internet Standards is available in Section 2 of 
            RFC 7841.
        </t>
        <t indent="0" pn="section-boilerplate.1-3">
            Information about the current status of this document, any
            errata, and how to provide feedback on it may be obtained at
            <eref target="https://www.rfc-editor.org/info/rfc9338" brackets="none"/>.
        </t>
      </section>
      <section anchor="copyright" numbered="false" removeInRFC="false" toc="exclude" pn="section-boilerplate.2">
        <name slugifiedName="name-copyright-notice">Copyright Notice</name>
        <t indent="0" pn="section-boilerplate.2-1">
            Copyright (c) 2022 IETF Trust and the persons identified as the
            document authors. All rights reserved.
        </t>
        <t indent="0" pn="section-boilerplate.2-2">
            This document is subject to BCP 78 and the IETF Trust's Legal
            Provisions Relating to IETF Documents
            (<eref target="https://trustee.ietf.org/license-info" brackets="none"/>) in effect on the date of
            publication of this document. Please review these documents
            carefully, as they describe your rights and restrictions with
            respect to this document. Code Components extracted from this
            document must include Revised BSD License text as described in
            Section 4.e of the Trust Legal Provisions and are provided without
            warranty as described in the Revised BSD License.
        </t>
      </section>
    </boilerplate>
    <toc>
      <section anchor="toc" numbered="false" removeInRFC="false" toc="exclude" pn="section-toc.1">
        <name slugifiedName="name-table-of-contents">Table of Contents</name>
        <ul bare="true" empty="true" indent="2" spacing="compact" pn="section-toc.1-1">
          <li pn="section-toc.1-1.1">
            <t indent="0" pn="section-toc.1-1.1.1"><xref derivedContent="1" format="counter" sectionFormat="of" target="section-1"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-introduction">Introduction</xref></t>
            <ul bare="true" empty="true" indent="2" spacing="compact" pn="section-toc.1-1.1.2">
              <li pn="section-toc.1-1.1.2.1">
                <t indent="0" keepWithNext="true" pn="section-toc.1-1.1.2.1.1"><xref derivedContent="1.1" format="counter" sectionFormat="of" target="section-1.1"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-requirements-terminology">Requirements Terminology</xref></t>
              </li>
              <li pn="section-toc.1-1.1.2.2">
                <t indent="0" keepWithNext="true" pn="section-toc.1-1.1.2.2.1"><xref derivedContent="1.2" format="counter" sectionFormat="of" target="section-1.2"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-cbor-grammar">CBOR Grammar</xref></t>
              </li>
              <li pn="section-toc.1-1.1.2.3">
                <t indent="0" keepWithNext="true" pn="section-toc.1-1.1.2.3.1"><xref derivedContent="1.3" format="counter" sectionFormat="of" target="section-1.3"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-document-terminology">Document Terminology</xref></t>
              </li>
            </ul>
          </li>
          <li pn="section-toc.1-1.2">
            <t indent="0" pn="section-toc.1-1.2.1"><xref derivedContent="2" format="counter" sectionFormat="of" target="section-2"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-countersignature-header-par">Countersignature Header Parameters</xref></t>
          </li>
          <li pn="section-toc.1-1.3">
            <t indent="0" pn="section-toc.1-1.3.1"><xref derivedContent="3" format="counter" sectionFormat="of" target="section-3"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-version-2-countersignatures">Version 2 Countersignatures</xref></t>
            <ul bare="true" empty="true" indent="2" spacing="compact" pn="section-toc.1-1.3.2">
              <li pn="section-toc.1-1.3.2.1">
                <t indent="0" pn="section-toc.1-1.3.2.1.1"><xref derivedContent="3.1" format="counter" sectionFormat="of" target="section-3.1"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-full-countersignatures">Full Countersignatures</xref></t>
              </li>
              <li pn="section-toc.1-1.3.2.2">
                <t indent="0" pn="section-toc.1-1.3.2.2.1"><xref derivedContent="3.2" format="counter" sectionFormat="of" target="section-3.2"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-abbreviated-countersignatur">Abbreviated Countersignatures</xref></t>
              </li>
              <li pn="section-toc.1-1.3.2.3">
                <t indent="0" pn="section-toc.1-1.3.2.3.1"><xref derivedContent="3.3" format="counter" sectionFormat="of" target="section-3.3"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-signing-and-verification-pr">Signing and Verification Process</xref></t>
              </li>
            </ul>
          </li>
          <li pn="section-toc.1-1.4">
            <t indent="0" pn="section-toc.1-1.4.1"><xref derivedContent="4" format="counter" sectionFormat="of" target="section-4"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-cbor-encoding-restrictions">CBOR Encoding Restrictions</xref></t>
          </li>
          <li pn="section-toc.1-1.5">
            <t indent="0" pn="section-toc.1-1.5.1"><xref derivedContent="5" format="counter" sectionFormat="of" target="section-5"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-iana-considerations">IANA Considerations</xref></t>
            <ul bare="true" empty="true" indent="2" spacing="compact" pn="section-toc.1-1.5.2">
              <li pn="section-toc.1-1.5.2.1">
                <t indent="0" pn="section-toc.1-1.5.2.1.1"><xref derivedContent="5.1" format="counter" sectionFormat="of" target="section-5.1"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-cbor-tags-registry">CBOR Tags Registry</xref></t>
              </li>
              <li pn="section-toc.1-1.5.2.2">
                <t indent="0" pn="section-toc.1-1.5.2.2.1"><xref derivedContent="5.2" format="counter" sectionFormat="of" target="section-5.2"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-cose-header-parameters-regi">COSE Header Parameters Registry</xref></t>
              </li>
            </ul>
          </li>
          <li pn="section-toc.1-1.6">
            <t indent="0" pn="section-toc.1-1.6.1"><xref derivedContent="6" format="counter" sectionFormat="of" target="section-6"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-security-considerations">Security Considerations</xref></t>
          </li>
          <li pn="section-toc.1-1.7">
            <t indent="0" pn="section-toc.1-1.7.1"><xref derivedContent="7" format="counter" sectionFormat="of" target="section-7"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-references">References</xref></t>
            <ul bare="true" empty="true" indent="2" spacing="compact" pn="section-toc.1-1.7.2">
              <li pn="section-toc.1-1.7.2.1">
                <t indent="0" pn="section-toc.1-1.7.2.1.1"><xref derivedContent="7.1" format="counter" sectionFormat="of" target="section-7.1"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-normative-references">Normative References</xref></t>
              </li>
              <li pn="section-toc.1-1.7.2.2">
                <t indent="0" pn="section-toc.1-1.7.2.2.1"><xref derivedContent="7.2" format="counter" sectionFormat="of" target="section-7.2"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-informative-references">Informative References</xref></t>
              </li>
            </ul>
          </li>
          <li pn="section-toc.1-1.8">
            <t indent="0" pn="section-toc.1-1.8.1"><xref derivedContent="Appendix A" format="default" sectionFormat="of" target="section-appendix.a"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-examples">Examples</xref></t>
            <ul bare="true" empty="true" indent="2" spacing="compact" pn="section-toc.1-1.8.2">
              <li pn="section-toc.1-1.8.2.1">
                <t indent="0" pn="section-toc.1-1.8.2.1.1"><xref derivedContent="A.1" format="counter" sectionFormat="of" target="section-appendix.a.1"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-examples-of-signed-messages">Examples of Signed Messages</xref></t>
                <ul bare="true" empty="true" indent="2" spacing="compact" pn="section-toc.1-1.8.2.1.2">
                  <li pn="section-toc.1-1.8.2.1.2.1">
                    <t indent="0" pn="section-toc.1-1.8.2.1.2.1.1"><xref derivedContent="A.1.1" format="counter" sectionFormat="of" target="section-appendix.a.1.1"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-countersignature">Countersignature</xref></t>
                  </li>
                </ul>
              </li>
              <li pn="section-toc.1-1.8.2.2">
                <t indent="0" pn="section-toc.1-1.8.2.2.1"><xref derivedContent="A.2" format="counter" sectionFormat="of" target="section-appendix.a.2"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-examples-of-signed1-message">Examples of Signed1 Messages</xref></t>
                <ul bare="true" empty="true" indent="2" spacing="compact" pn="section-toc.1-1.8.2.2.2">
                  <li pn="section-toc.1-1.8.2.2.2.1">
                    <t indent="0" pn="section-toc.1-1.8.2.2.2.1.1"><xref derivedContent="A.2.1" format="counter" sectionFormat="of" target="section-appendix.a.2.1"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-countersignature-2">Countersignature</xref></t>
                  </li>
                </ul>
              </li>
              <li pn="section-toc.1-1.8.2.3">
                <t indent="0" pn="section-toc.1-1.8.2.3.1"><xref derivedContent="A.3" format="counter" sectionFormat="of" target="section-appendix.a.3"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-examples-of-enveloped-messa">Examples of Enveloped Messages</xref></t>
                <ul bare="true" empty="true" indent="2" spacing="compact" pn="section-toc.1-1.8.2.3.2">
                  <li pn="section-toc.1-1.8.2.3.2.1">
                    <t indent="0" pn="section-toc.1-1.8.2.3.2.1.1"><xref derivedContent="A.3.1" format="counter" sectionFormat="of" target="section-appendix.a.3.1"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-countersignature-on-encrypt">Countersignature on Encrypted Content</xref></t>
                  </li>
                </ul>
              </li>
              <li pn="section-toc.1-1.8.2.4">
                <t indent="0" pn="section-toc.1-1.8.2.4.1"><xref derivedContent="A.4" format="counter" sectionFormat="of" target="section-appendix.a.4"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-examples-of-encrypted-messa">Examples of Encrypted Messages</xref></t>
                <ul bare="true" empty="true" indent="2" spacing="compact" pn="section-toc.1-1.8.2.4.2">
                  <li pn="section-toc.1-1.8.2.4.2.1">
                    <t indent="0" pn="section-toc.1-1.8.2.4.2.1.1"><xref derivedContent="A.4.1" format="counter" sectionFormat="of" target="section-appendix.a.4.1"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-countersignature-on-encrypte">Countersignature on Encrypted Content</xref></t>
                  </li>
                </ul>
              </li>
              <li pn="section-toc.1-1.8.2.5">
                <t indent="0" pn="section-toc.1-1.8.2.5.1"><xref derivedContent="A.5" format="counter" sectionFormat="of" target="section-appendix.a.5"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-examples-of-maced-messages">Examples of MACed Messages</xref></t>
                <ul bare="true" empty="true" indent="2" spacing="compact" pn="section-toc.1-1.8.2.5.2">
                  <li pn="section-toc.1-1.8.2.5.2.1">
                    <t indent="0" pn="section-toc.1-1.8.2.5.2.1.1"><xref derivedContent="A.5.1" format="counter" sectionFormat="of" target="section-appendix.a.5.1"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-countersignature-on-mac-con">Countersignature on MAC Content</xref></t>
                  </li>
                </ul>
              </li>
              <li pn="section-toc.1-1.8.2.6">
                <t indent="0" pn="section-toc.1-1.8.2.6.1"><xref derivedContent="A.6" format="counter" sectionFormat="of" target="section-appendix.a.6"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-examples-of-mac0-messages">Examples of MAC0 Messages</xref></t>
                <ul bare="true" empty="true" indent="2" spacing="compact" pn="section-toc.1-1.8.2.6.2">
                  <li pn="section-toc.1-1.8.2.6.2.1">
                    <t indent="0" pn="section-toc.1-1.8.2.6.2.1.1"><xref derivedContent="A.6.1" format="counter" sectionFormat="of" target="section-appendix.a.6.1"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-countersignature-on-mac0-co">Countersignature on MAC0 Content</xref></t>
                  </li>
                </ul>
              </li>
            </ul>
          </li>
          <li pn="section-toc.1-1.9">
            <t indent="0" pn="section-toc.1-1.9.1"><xref derivedContent="" format="none" sectionFormat="of" target="section-appendix.b"/><xref derivedContent="" format="title" sectionFormat="of" target="name-acknowledgments">Acknowledgments</xref></t>
          </li>
          <li pn="section-toc.1-1.10">
            <t indent="0" pn="section-toc.1-1.10.1"><xref derivedContent="" format="none" sectionFormat="of" target="section-appendix.c"/><xref derivedContent="" format="title" sectionFormat="of" target="name-authors-address">Author's Address</xref></t>
          </li>
        </ul>
      </section>
    </toc>
  </front>
  <middle>
    <section anchor="introduction" numbered="true" removeInRFC="false" toc="include" pn="section-1">
      <name slugifiedName="name-introduction">Introduction</name>
      <t indent="0" pn="section-1-1">
        There has been an increased focus on small, constrained devices that make up the Internet of Things (IoT). 
        One of the standards that has come out of this process is "<xref target="RFC8949" format="title" sectionFormat="of" derivedContent="Concise Binary Object Representation (CBOR)"/>" <xref target="RFC8949" format="default" sectionFormat="of" derivedContent="RFC8949"/>.
        CBOR extended the data model of the JavaScript Object Notation (JSON) <xref target="STD90" format="default" sectionFormat="of" derivedContent="STD90"/> by allowing for binary data, among other changes. 
        CBOR has been adopted by several of the IETF working groups dealing with the IoT world as their method of encoding data structures.
        CBOR was designed specifically to be small in terms of both messages transported and implementation size and to have a schema-free decoder.
        A need exists to provide message security services for IoT, and using CBOR as the message-encoding format makes sense.
      </t>
      <t indent="0" pn="section-1-2">
        A countersignature is a second signature that confirms the primary signature.
        During the process of advancing CBOR Object Signing and Encryption (COSE) to Internet Standard, it was noticed that the description of the security properties of countersignatures was incorrect for the COSE_Sign1 structure mentioned in <xref section="4.5" target="RFC8152" format="default" sectionFormat="of" derivedLink="https://rfc-editor.org/rfc/rfc8152#section-4.5" derivedContent="RFC8152"/>.
        To remedy this situation, the COSE Working Group decided to remove all of the countersignature text from <xref target="RFC9052" format="default" sectionFormat="of" derivedContent="RFC9052"/>, which obsoletes <xref target="RFC8152" format="default" sectionFormat="of" derivedContent="RFC8152"/>.
        This document defines a new countersignature with the desired security properties.
      </t>
      <t indent="0" pn="section-1-3">
        The problem with the previous countersignature algorithm was that the cryptographically computed value was not always included.
        The initial assumption that the cryptographic value was in the third slot of the array was known not to be true at the time, but in the case of the Message Authentication Code (MAC) structures this was not deemed to be an issue.
        The new algorithm defined in this document requires the inclusion of more values for the countersignature computation.
        The exception to this is the COSE_Signature structure where there is no cryptographically computed value.
      </t>
      <t indent="0" pn="section-1-4">
        The new algorithm defined in this document is designed to produce the same countersignature value in those cases where the computed cryptographic value was already included.
        This means that for those structures the only thing that would need to be done is to change the value of the header parameter.
      </t>
      <t indent="0" pn="section-1-5">
        With the publication of this document, implementers are encouraged to migrate uses of the previous countersignature algorithm to the one specified in this document.
        In particular, uses of "CounterSignature" will migrate to "CounterSignatureV2", and uses of "CounterSignature0" will migrate to "CounterSignature0V2".
        In addition, verification of "CounterSignature" must be supported by new implementations to remain compatible with senders that adhere to <xref target="RFC8152" format="default" sectionFormat="of" derivedContent="RFC8152"/>, which assumes that all implementations will understand "CounterSignature" as header parameter label 7.
        Likewise, verification of "CounterSignature0" may be supported for further compatibility.
      </t>
      <section anchor="requirements-terminology" numbered="true" removeInRFC="false" toc="include" pn="section-1.1">
        <name slugifiedName="name-requirements-terminology">Requirements Terminology</name>
        <t indent="0" pn="section-1.1-1">The key words "<bcp14>MUST</bcp14>", "<bcp14>MUST NOT</bcp14>",
       "<bcp14>REQUIRED</bcp14>", "<bcp14>SHALL</bcp14>",
       "<bcp14>SHALL NOT</bcp14>", "<bcp14>SHOULD</bcp14>",
       "<bcp14>SHOULD NOT</bcp14>",
       "<bcp14>RECOMMENDED</bcp14>", "<bcp14>NOT RECOMMENDED</bcp14>",
       "<bcp14>MAY</bcp14>", and "<bcp14>OPTIONAL</bcp14>" in this document
       are to be interpreted as described in BCP 14
       <xref target="RFC2119" format="default" sectionFormat="of" derivedContent="RFC2119"/> <xref target="RFC8174" format="default" sectionFormat="of" derivedContent="RFC8174"/> when, and only
       when, they appear in all capitals, as shown here.</t>
      </section>
      <section anchor="cbor-grammar" numbered="true" removeInRFC="false" toc="include" pn="section-1.2">
        <name slugifiedName="name-cbor-grammar">CBOR Grammar</name>
        <t indent="0" pn="section-1.2-1">
          CBOR grammar in this document uses the Concise Data Definition Language (CDDL) <xref target="RFC8610" format="default" sectionFormat="of" derivedContent="RFC8610"/>.
        </t>
        <t indent="0" pn="section-1.2-2">
          The collected CDDL can be extracted from the XML version of this document via the XPath expression below.  (Depending on the XPath evaluator one is using, it may be necessary to deal with &amp;gt; as an entity.)
        </t>
        <sourcecode type="xpath" markers="false" pn="section-1.2-3">
      //sourcecode[@type='cddl']/text()
</sourcecode>
        <t indent="0" pn="section-1.2-4">CDDL expects the initial non-terminal symbol to be the first symbol in the file.  For this reason, the first fragment of CDDL is presented here.</t>
        <sourcecode type="cddl" markers="false" pn="section-1.2-5">
      start = COSE_Countersignature_Tagged / Internal_Types

      ; This is defined to make the tool quieter:
      Internal_Types = Countersign_structure / COSE_Countersignature0
</sourcecode>
        <t indent="0" pn="section-1.2-6">The non-terminal Internal_Types is defined for dealing with the automated validation tools used during the writing of this document.  It references those non-terminals that are used for security computations but are not emitted for transport.  </t>
      </section>
      <section numbered="true" removeInRFC="false" toc="include" pn="section-1.3">
        <name slugifiedName="name-document-terminology">Document Terminology</name>
        <t indent="0" pn="section-1.3-1">
          In this document, we use the following terminology.
        </t>
        <t indent="0" pn="section-1.3-2">
          "Byte" is a synonym for "octet".
        </t>
        <t indent="0" pn="section-1.3-3">
          The Constrained Application Protocol (CoAP) is a specialized web transfer protocol for use in constrained systems.  It is defined in <xref target="RFC7252" format="default" sectionFormat="of" derivedContent="RFC7252"/>.
        </t>
        <t indent="0" pn="section-1.3-4">
          "Context" is used throughout this document to represent information that is not part of the COSE message.
          Information that is part of the context can come from different sources, including protocol interactions, associated key structures, and application configuration.
          The context to use can be implicit, identified using either the "kid context" header parameter defined in <xref target="RFC8613" format="default" sectionFormat="of" derivedContent="RFC8613"/> or a protocol-specific identifier.
          Context should generally be included in the cryptographic construction; for more details, see <xref section="4.4" target="RFC9052" format="default" sectionFormat="of" derivedLink="https://rfc-editor.org/rfc/rfc9052#section-4.4" derivedContent="RFC9052"/>.
        </t>
        <t indent="0" pn="section-1.3-5">
          The term "byte string" is used for sequences of bytes, while the term "text string" is used for sequences of characters.
        </t>
      </section>
    </section>
    <section numbered="true" removeInRFC="false" toc="include" pn="section-2">
      <name slugifiedName="name-countersignature-header-par">Countersignature Header Parameters</name>
      <t indent="0" pn="section-2-1">This section defines a set of common header parameters.  A summary of these header parameters can be found in <xref target="Header-Table" format="default" sectionFormat="of" derivedContent="Table 1"/>.  This table should be consulted to determine the value of the label and the type of the value.</t>
      <t indent="0" pn="section-2-2">The set of header parameters defined in this section is:</t>
      <dl newline="false" indent="3" spacing="normal" pn="section-2-3">
        <dt pn="section-2-3.1">V2 countersignature:</dt>
        <dd pn="section-2-3.2">
          This header parameter holds one or more countersignature values. 
          Countersignatures provide a method of having a second party sign some data. 
          The countersignature header parameter can occur as an unprotected attribute in any of the following structures that are defined in <xref target="RFC9052" format="default" sectionFormat="of" derivedContent="RFC9052"/>: COSE_Sign1, COSE_Signature, COSE_Encrypt, COSE_recipient, COSE_Encrypt0, COSE_Mac, and COSE_Mac0. 
          Details of version 2 countersignatures are found in <xref target="counter_signatureV2" format="default" sectionFormat="of" derivedContent="Section 3"/>. 
        </dd>
      </dl>
      <table anchor="Header-Table" align="center" pn="table-1">
        <name slugifiedName="name-common-header-parameters">Common Header Parameters</name>
        <thead>
          <tr>
            <th align="left" colspan="1" rowspan="1">Name</th>
            <th align="left" colspan="1" rowspan="1">Label</th>
            <th align="left" colspan="1" rowspan="1">Value Type</th>
            <th align="left" colspan="1" rowspan="1">Description</th>
          </tr>
        </thead>
        <tbody>
          <tr>
            <td align="left" colspan="1" rowspan="1">Countersignature version 2</td>
            <td align="left" colspan="1" rowspan="1">11</td>
            <td align="left" colspan="1" rowspan="1">COSE_Countersignature / [+ COSE_Countersignature ]</td>
            <td align="left" colspan="1" rowspan="1">V2 countersignature attribute</td>
          </tr>
          <tr>
            <td align="left" colspan="1" rowspan="1">Countersignature0 version 2</td>
            <td align="left" colspan="1" rowspan="1">12</td>
            <td align="left" colspan="1" rowspan="1">COSE_Countersignature0</td>
            <td align="left" colspan="1" rowspan="1">V2 Abbreviated Countersignature</td>
          </tr>
        </tbody>
      </table>
      <t indent="0" pn="section-2-5">
        The CDDL fragment that represents the set of header parameters defined in this section is given below.
        Each of the header parameters is tagged as optional because they do not need to be in every map; however, the header parameters required in specific maps are discussed above.
      </t>
      <sourcecode type="cddl" markers="false" pn="section-2-6">
      CountersignatureV2_header = (
          ? 11 =&gt; COSE_Countersignature / [+ COSE_Countersignature]
      )

      Countersignature0V2_header = (
          ? 12 =&gt; COSE_Countersignature0
      )
</sourcecode>
    </section>
    <section anchor="counter_signatureV2" numbered="true" removeInRFC="false" toc="include" pn="section-3">
      <name slugifiedName="name-version-2-countersignatures">Version 2 Countersignatures</name>
      <t indent="0" pn="section-3-1">
        A countersignature is normally defined as a second signature that confirms a primary signature.
        A normal example of a countersignature is the signature that a notary public places on a document as witnessing that you have signed the document.
        A notary typically includes a timestamp to indicate when notarization occurs; however, such a timestamp has not yet been defined for COSE.
        A timestamp, once defined in a future document, might be included as a protected header parameter.
        Thus, applying a countersignature to either the COSE_Signature or COSE_Sign1 objects matches this traditional definition.
        This document extends the context of a countersignature to allow it to be applied to all of the security structures defined.
        The countersignature needs to be treated as a separate operation from the initial operation even if it is applied by the same user, as is done in <xref target="GROUP-OSCORE" format="default" sectionFormat="of" derivedContent="GROUP-OSCORE"/>.
      </t>
      <t indent="0" pn="section-3-2">
        COSE supports two different forms for countersignatures.
        Full countersignatures use the structure COSE_Countersignature, which has the same structure as COSE_Signature.
        Thus, full countersignatures can have protected and unprotected attributes, including chained countersignatures.
        Abbreviated countersignatures use the structure COSE_Countersignature0.
        This structure only contains the signature value and nothing else.
        The structures cannot be converted between each other; as the signature computation includes a parameter identifying which structure is being used, the converted structure will fail signature validation.
      </t>
      <t indent="0" pn="section-3-3">
        The version 2 countersignature changes the algorithm used for computing the signature from the original version that is specified in <xref section="4.5" target="RFC8152" format="default" sectionFormat="of" derivedLink="https://rfc-editor.org/rfc/rfc8152#section-4.5" derivedContent="RFC8152"/>.
        The new version now includes the cryptographic material generated for all of the structures rather than just for a subset.
      </t>
      <t indent="0" pn="section-3-4">
        COSE was designed for uniformity in how the data structures are specified.
        One result of this is that for COSE one can expand the concept of countersignatures beyond just the idea of signing a signature to being able to sign most of the structures without having to create a new signing layer.
        When creating a countersignature, one needs to be clear about the security properties that result.
        When done on a COSE_Signature or COSE_Sign1, the normal countersignature semantics are preserved.
        That is, the countersignature makes a statement about the existence of a signature and, when used with a yet-to-be-specified timestamp, a point in time at which the signature exists.
        When done on a COSE_Mac or COSE_Mac0, the payload is included as well as the MAC value.
        When done on a COSE_Encrypt or COSE_Encrypt0, the existence of the encrypted data is attested to.
        It should be noted that there is a distinction between attesting to the encrypted data as opposed to attesting to the unencrypted data.
        If the latter is what is desired, then one needs to apply a signature to the data and then encrypt that.
        It is always possible to construct cases where the use of two different keys results in successful decryption, where the tag check succeeds, but two completely different plaintexts are produced.
        This situation is not detectable by a countersignature on the encrypted data.
      </t>
      <section anchor="Full_Countersig" numbered="true" removeInRFC="false" toc="include" pn="section-3.1">
        <name slugifiedName="name-full-countersignatures">Full Countersignatures</name>
        <t indent="0" pn="section-3.1-1">
          The COSE_Countersignature structure allows for the same set of capabilities  as a COSE_Signature.
          This means that all of the capabilities of a signature are duplicated with this structure.
          Specifically, the countersigner does not need to be related to the producer of what is being countersigned, as key and algorithm identification can be placed in the countersignature attributes.
          This also means that the countersignature can itself be countersigned.
          This is a feature required by protocols such as long-term archiving services.
          More information on how countersignatures are used can be found in the evidence record syntax described in <xref target="RFC4998" format="default" sectionFormat="of" derivedContent="RFC4998"/>.
        </t>
        <t indent="0" pn="section-3.1-2">
          The full countersignature structure can be encoded as either tagged or untagged, depending on the context.
          A tagged COSE_Countersignature structure is identified by the CBOR tag 19.
          The countersignature structure is the same as that used for a signer on a signed object.
          The CDDL fragment for full countersignatures is:
        </t>
        <sourcecode type="cddl" markers="false" pn="section-3.1-3">
      COSE_Countersignature_Tagged = #6.19(COSE_Countersignature)
      COSE_Countersignature = COSE_Signature
</sourcecode>
        <t indent="0" pn="section-3.1-4">
          The details of the fields of a countersignature can be found in <xref section="4.1" target="RFC9052" format="default" sectionFormat="of" derivedLink="https://rfc-editor.org/rfc/rfc9052#section-4.1" derivedContent="RFC9052"/>.
        </t>
        <t indent="0" pn="section-3.1-5">          
          An example of a countersignature on a signature can be found in <xref target="Appendix_A_1_1" format="default" sectionFormat="of" derivedContent="Appendix A.1.1"/>. 
          An example of a countersignature in an encryption object can be found in <xref target="Appendix_A_2_1" format="default" sectionFormat="of" derivedContent="Appendix A.3.1"/>. 
        </t>
        <t indent="0" pn="section-3.1-6">
          It should be noted that only a signature algorithm with appendix (see <xref section="8.1" target="RFC9052" format="default" sectionFormat="of" derivedLink="https://rfc-editor.org/rfc/rfc9052#section-8.1" derivedContent="RFC9052"/>) can be used for countersignatures. 
          This is because the body should be able to be processed without having to evaluate the countersignature, and this is not possible for signature schemes with message recovery. 
        </t>
      </section>
      <section anchor="Abbrev_Countersig" numbered="true" removeInRFC="false" toc="include" pn="section-3.2">
        <name slugifiedName="name-abbreviated-countersignatur">Abbreviated Countersignatures</name>
        <t indent="0" pn="section-3.2-1">
          Abbreviated countersignatures support encrypted group messaging where identification of the message originator is required but there is a desire to keep the countersignature as small as possible.
          For abbreviated countersignatures, there is no provision for any protected attributes related to the signing operation.
          That is, the parameters for computing or verifying the abbreviated countersignature are provided by the same context used to describe the encryption, signature, or MAC processing.
        </t>
        <t indent="0" pn="section-3.2-2">
          The CDDL fragment for the abbreviated countersignatures is:
        </t>
        <sourcecode type="cddl" markers="false" pn="section-3.2-3">
      COSE_Countersignature0 = bstr
</sourcecode>
        <t indent="0" pn="section-3.2-4">
          The byte string representing the signature value is placed in the Countersignature0 attribute.
          This attribute is then encoded as an unprotected header parameter.
        </t>
      </section>
      <section anchor="CountersignV2_verify" numbered="true" removeInRFC="false" toc="include" pn="section-3.3">
        <name slugifiedName="name-signing-and-verification-pr">Signing and Verification Process</name>
        <t indent="0" pn="section-3.3-1">
          In order to create a signature, a well-defined byte string is needed.
          The Countersign_structure is used to create the canonical form. 
          This signing and verification process takes in the countersignature target structure (COSE_Signature, COSE_Sign1, COSE_Sign, COSE_Mac, COSE_Mac0, COSE_Encrypt, or COSE_Encrypt0), the signer information (COSE_Signature), and the application data (external source). 
          A Countersign_structure is a CBOR array.
          The target structure of the countersignature needs to have all of its cryptographic functions finalized before computing the signature.
          The fields of the Countersign_structure, in order, are:
        </t>
        <dl indent="3" newline="false" spacing="normal" pn="section-3.3-2">
          <dt pn="section-3.3-2.1">context:</dt>
          <dd pn="section-3.3-2.2">
            <t indent="0" pn="section-3.3-2.2.1">
            A context text string identifying the context of the signature.  The context text string is one of the following:</t>
            <ul bare="false" empty="false" indent="3" spacing="normal" pn="section-3.3-2.2.2">
              <li pn="section-3.3-2.2.2.1">"CounterSignature" for countersignatures using the COSE_Countersignature structure when other_fields is absent.</li>
              <li pn="section-3.3-2.2.2.2">"CounterSignature0" for countersignatures using the COSE_Countersignature0 structure when other_fields is absent.</li>
              <li pn="section-3.3-2.2.2.3">"CounterSignatureV2" for countersignatures using the COSE_Countersignature structure when other_fields is present.</li>
              <li pn="section-3.3-2.2.2.4">"CounterSignature0V2" for countersignatures using the COSE_Countersignature0 structure when other_fields is present.</li>
            </ul>
          </dd>
          <dt pn="section-3.3-2.3">body_protected:</dt>
          <dd pn="section-3.3-2.4">
            The serialized protected attributes from the target structure, encoded in a bstr type.
            If there are no protected attributes, a zero-length byte string is used.
          </dd>
          <dt pn="section-3.3-2.5">sign_protected:</dt>
          <dd pn="section-3.3-2.6">
            The serialized protected attributes from the signer structure, encoded in a bstr type.
            If there are no protected attributes, a zero-length byte string is used. 
            This field is omitted for the Countersignature0V2 attribute.
          </dd>
          <dt pn="section-3.3-2.7">external_aad:</dt>
          <dd pn="section-3.3-2.8">
            The externally supplied additional authenticated data (AAD) from the application, encoded in a bstr type.
            If this field is not supplied, it defaults to a zero-length byte string.
            (See <xref section="4.4" target="RFC9052" format="default" sectionFormat="of" derivedLink="https://rfc-editor.org/rfc/rfc9052#section-4.4" derivedContent="RFC9052"/> for application guidance on constructing this field.)
          </dd>
          <dt pn="section-3.3-2.9">payload:</dt>
          <dd pn="section-3.3-2.10">          
            The payload to be signed, encoded in a bstr type.
            The payload is placed here independently of how it is transported.
          </dd>
          <dt pn="section-3.3-2.11">other_fields:</dt>
          <dd pn="section-3.3-2.12"> 
            Omitted if there are only two bstr fields in the target structure.
            This field is an array of all bstr fields after the second.
            As an example, this would be an array of one element for the COSE_Sign1 structure containing the signature value.
          </dd>
        </dl>
        <t indent="0" pn="section-3.3-3">The CDDL fragment that describes the above text is:  </t>
        <sourcecode type="cddl" markers="false" pn="section-3.3-4">
      Countersign_structure = [
        context : "CounterSignature" / "CounterSignature0" /
                  "CounterSignatureV2" / "CounterSignature0V2" /,
        body_protected : empty_or_serialized_map,
        ? sign_protected : empty_or_serialized_map,
        external_aad : bstr,
        payload : bstr,
        ? other_fields : [+ bstr ]
      ]
</sourcecode>
        <t indent="0" pn="section-3.3-5">How to compute a countersignature:
        </t>
        <ol type="1" indent="adaptive" spacing="normal" start="1" pn="section-3.3-6">
          <li pn="section-3.3-6.1" derivedCounter="1.">Create a Countersign_structure and populate it with the appropriate fields.  </li>
          <li pn="section-3.3-6.2" derivedCounter="2.">Create the value ToBeSigned by encoding the Countersign_structure to a byte string, using the encoding described in <xref target="CBOR-Canonical" format="default" sectionFormat="of" derivedContent="Section 4"/>.  </li>
          <li pn="section-3.3-6.3" derivedCounter="3.">Call the signature creation algorithm passing in K (the key to sign with), alg (the algorithm to sign with), and ToBeSigned (the value to sign).  </li>
          <li pn="section-3.3-6.4" derivedCounter="4.">
            Place the resulting signature value in the correct location.
            This is the "signature" field of the COSE_Countersignature structure for full countersignatures (see <xref target="Full_Countersig" format="default" sectionFormat="of" derivedContent="Section 3.1"/>).
            This is the value of the Countersignature0 attribute for abbreviated countersignatures (see <xref target="Abbrev_Countersig" format="default" sectionFormat="of" derivedContent="Section 3.2"/>).
          </li>
        </ol>
        <t indent="0" pn="section-3.3-7">The steps for verifying a countersignature:
        </t>
        <ol type="1" indent="adaptive" spacing="normal" start="1" pn="section-3.3-8">
          <li pn="section-3.3-8.1" derivedCounter="1.">Create a Countersign_structure and populate it with the appropriate fields.  </li>
          <li pn="section-3.3-8.2" derivedCounter="2.">Create the value ToBeSigned by encoding the Countersign_structure to a byte string, using the encoding described in <xref target="CBOR-Canonical" format="default" sectionFormat="of" derivedContent="Section 4"/>.  </li>
          <li pn="section-3.3-8.3" derivedCounter="3.">Call the signature verification algorithm passing in K (the key to verify with), alg (the algorithm used to sign with), ToBeSigned (the value to sign), and sig (the signature to be verified).  </li>
        </ol>
        <t indent="0" pn="section-3.3-9">
          In addition to performing the signature verification, the application performs the appropriate checks to ensure that the key is correctly paired with the signing identity and that the signing identity is authorized before performing actions.
        </t>
      </section>
    </section>
    <section anchor="CBOR-Canonical" numbered="true" removeInRFC="false" toc="include" pn="section-4">
      <name slugifiedName="name-cbor-encoding-restrictions">CBOR Encoding Restrictions</name>
      <t indent="0" pn="section-4-1">
        The deterministic encoding rules are defined in <xref section="4.2" target="RFC8949" format="default" sectionFormat="of" derivedLink="https://rfc-editor.org/rfc/rfc8949#section-4.2" derivedContent="RFC8949"/>.
        These rules are further narrowed in <xref section="9" target="RFC9052" format="default" sectionFormat="of" derivedLink="https://rfc-editor.org/rfc/rfc9052#section-9" derivedContent="RFC9052"/>.
        The narrowed deterministic encoding rules <bcp14>MUST</bcp14> be used to ensure that all implementations generate the same byte string for the "to be signed" value.
      </t>
    </section>
    <section anchor="iana-considerations" numbered="true" removeInRFC="false" toc="include" pn="section-5">
      <name slugifiedName="name-iana-considerations">IANA Considerations</name>
      <t indent="0" pn="section-5-1">
        The registries and registrations listed below were created during the processing of <xref target="RFC8152" format="default" sectionFormat="of" derivedContent="RFC8152"/>.
        The majority of the actions are to update the references to point to this document.
      </t>
      <section anchor="cbor-tag-assignment" numbered="true" removeInRFC="false" toc="include" pn="section-5.1">
        <name slugifiedName="name-cbor-tags-registry">CBOR Tags Registry</name>
        <t indent="0" pn="section-5.1-1">IANA created a registry titled "CBOR Tags" registry as part of
  processing RFC 7049, which was subsequently replaced by
  <xref target="RFC8949" format="default" sectionFormat="of" derivedContent="RFC8949"/>.</t>
        <t indent="0" pn="section-5.1-2">
          IANA has assigned a new tag for the CounterSignature type in the "CBOR Tags" registry.
        </t>
        <dl newline="false" spacing="compact" indent="3" pn="section-5.1-3">
          <dt pn="section-5.1-3.1">Tag:</dt>
          <dd pn="section-5.1-3.2">19</dd>
          <dt pn="section-5.1-3.3">Data Item:</dt>
          <dd pn="section-5.1-3.4"> COSE_Countersignature</dd>
          <dt pn="section-5.1-3.5">Semantics:</dt>
          <dd pn="section-5.1-3.6">COSE standalone V2 countersignature</dd>
          <dt pn="section-5.1-3.7">Reference:</dt>
          <dd pn="section-5.1-3.8">RFC 9338</dd>
        </dl>
      </section>
      <section anchor="cose-header-key-table" numbered="true" removeInRFC="false" toc="include" pn="section-5.2">
        <name slugifiedName="name-cose-header-parameters-regi">COSE Header Parameters Registry</name>
        <t indent="0" pn="section-5.2-1">
          IANA created a registry titled "COSE Header Parameters" as part of processing <xref target="RFC8152" format="default" sectionFormat="of" derivedContent="RFC8152"/>. 
        </t>
        <t indent="0" pn="section-5.2-2">
          IANA has registered the Countersignature version 2 (label 11) and
Countersignature0 version 2 (label 12) in the "COSE Header
Parameters" registry.  For these entries, the "Value Type" and
"Description" are shown in Table 1, the "Value Registry" is blank,
and the "Reference" is "RFC 9338".
        </t>
        <table align="center" pn="table-2">
          <name slugifiedName="name-new-common-header-parameter">New Common Header Parameters</name>
          <thead>
            <tr>
              <th align="left" colspan="1" rowspan="1">Name</th>
              <th align="left" colspan="1" rowspan="1">Label</th>
              <th align="left" colspan="1" rowspan="1">Value Type</th>
              <th align="left" colspan="1" rowspan="1">Description</th>
            </tr>
          </thead>
          <tbody>
            <tr>
              <td align="left" colspan="1" rowspan="1">Countersignature version 2</td>
              <td align="left" colspan="1" rowspan="1">11</td>
              <td align="left" colspan="1" rowspan="1">COSE_Countersignature / [+ COSE_Countersignature ]</td>
              <td align="left" colspan="1" rowspan="1">V2 countersignature attribute</td>
            </tr>
            <tr>
              <td align="left" colspan="1" rowspan="1">Countersignature0 version 2</td>
              <td align="left" colspan="1" rowspan="1">12</td>
              <td align="left" colspan="1" rowspan="1">COSE_Countersignature0</td>
              <td align="left" colspan="1" rowspan="1">V2 Abbreviated Countersignature</td>
            </tr>
          </tbody>
        </table>
        <t indent="0" pn="section-5.2-4">
          IANA has modified the existing "Description" field for "counter signature" (7)
          and "CounterSignature0" (9) to include the words "(Deprecated by
          RFC 9338)".
        </t>
      </section>
    </section>
    <section anchor="security-considerations" numbered="true" removeInRFC="false" toc="include" pn="section-6">
      <name slugifiedName="name-security-considerations">Security Considerations</name>
      <t indent="0" pn="section-6-1">
        Please review the Security Considerations section in <xref target="RFC9052" format="default" sectionFormat="of" derivedContent="RFC9052"/>; these considerations apply to this document as well, especially the need for implementations to protect private key material.
      </t>
      <t indent="0" pn="section-6-2">
        When either COSE_Encrypt or COSE_Mac is used and more than two parties share the key, data origin authentication is not provided. Any party that knows the message-authentication key can compute a valid authentication tag; therefore, the contents could originate from any one of the parties that share the key.
      </t>
      <t indent="0" pn="section-6-3">
        Countersignatures of COSE_Encrypt and COSE_Mac with short authentication tags do not provide the security properties associated with the same algorithm used in COSE_Sign.
        To provide 128-bit security against collision attacks, the tag length <bcp14>MUST</bcp14> be at least 256 bits.
        A countersignature of a COSE_Mac with AES-MAC (using a 128-bit key or larger) provides at most 64 bits of integrity protection.
        Similarly, a countersignature of a COSE_Encrypt with AES-CCM-16-64-128 provides at most 32 bits of integrity protection.
      </t>
    </section>
  </middle>
  <back>
    <references pn="section-7">
      <name slugifiedName="name-references">References</name>
      <references pn="section-7.1">
        <name slugifiedName="name-normative-references">Normative References</name>
        <reference anchor="RFC2119" target="https://www.rfc-editor.org/info/rfc2119" quoteTitle="true" derivedAnchor="RFC2119">
          <front>
            <title>Key words for use in RFCs to Indicate Requirement Levels</title>
            <author fullname="S. Bradner" initials="S." surname="Bradner"/>
            <date month="March" year="1997"/>
            <abstract>
              <t indent="0">In many standards track documents several words are used to signify the requirements in the specification.  These words are often capitalized.  This document defines these words as they should be interpreted in IETF documents.  This document specifies an Internet Best Current Practices for the Internet Community, and requests discussion and suggestions for improvements.</t>
            </abstract>
          </front>
          <seriesInfo name="BCP" value="14"/>
          <seriesInfo name="RFC" value="2119"/>
          <seriesInfo name="DOI" value="10.17487/RFC2119"/>
          <format target="https://www.rfc-editor.org/info/rfc2119" type="TXT"/>
        </reference>
        <reference anchor="RFC8174" target="https://www.rfc-editor.org/info/rfc8174" quoteTitle="true" derivedAnchor="RFC8174">
          <front>
            <title>Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words</title>
            <author fullname="B. Leiba" initials="B." surname="Leiba"/>
            <date month="May" year="2017"/>
            <abstract>
              <t indent="0">RFC 2119 specifies common key words that may be used in protocol specifications.  This document aims to reduce the ambiguity by clarifying that only UPPERCASE usage of the key words have the defined special meanings.</t>
            </abstract>
          </front>
          <seriesInfo name="BCP" value="14"/>
          <seriesInfo name="RFC" value="8174"/>
          <seriesInfo name="DOI" value="10.17487/RFC8174"/>
          <format target="https://www.rfc-editor.org/info/rfc8174" type="TXT"/>
        </reference>
        <reference anchor="RFC9052" target="https://www.rfc-editor.org/info/rfc9052" quoteTitle="true" derivedAnchor="RFC9052">
          <front>
            <title>CBOR Object Signing and Encryption (COSE): Structures and Process</title>
            <author fullname="J. Schaad" initials="J." surname="Schaad"/>
            <date month="August" year="2022"/>
            <abstract>
              <t indent="0">Concise Binary Object Representation (CBOR) is a data format designed for small code size and small message size. There is a need to be able to define basic security services for this data format. This document defines the CBOR Object Signing and Encryption (COSE) protocol. This specification describes how to create and process signatures, message authentication codes, and encryption using CBOR for serialization. This specification additionally describes how to represent cryptographic keys using CBOR.</t>
              <t indent="0">This document, along with RFC 9053, obsoletes RFC 8152.</t>
            </abstract>
          </front>
          <seriesInfo name="STD" value="96"/>
          <seriesInfo name="RFC" value="9052"/>
          <seriesInfo name="DOI" value="10.17487/RFC9052"/>
          <format target="https://www.rfc-editor.org/info/rfc9052" type="TXT"/>
        </reference>
      </references>
      <references pn="section-7.2">
        <name slugifiedName="name-informative-references">Informative References</name>
        <reference anchor="CBORDIAG" target="https://github.com/cabo/cbor-diag" quoteTitle="true" derivedAnchor="CBORDIAG">
          <front>
            <title>CBOR diagnostic utilities</title>
            <author fullname="C. Bormann" initials="C." surname="Bormann"/>
            <date month="September" year="2022"/>
          </front>
          <refcontent> commit 1952a04</refcontent>
        </reference>
        <reference anchor="GROUP-OSCORE" quoteTitle="true" target="https://datatracker.ietf.org/doc/html/draft-ietf-core-oscore-groupcomm-16" derivedAnchor="GROUP-OSCORE">
          <front>
            <title>Group OSCORE - Secure Group Communication for CoAP</title>
            <author initials="M" surname="Tiloca" fullname="Marco Tiloca">
              <organization showOnFrontPage="true">RISE AB</organization>
            </author>
            <author initials="G" surname="Selander" fullname="Göran Selander">
              <organization showOnFrontPage="true">Ericsson AB</organization>
            </author>
            <author initials="F" surname="Palombini" fullname="Francesca Palombini">
              <organization showOnFrontPage="true">Ericsson AB</organization>
            </author>
            <author initials="J" surname="Mattsson" fullname="John Preuss Mattsson">
              <organization showOnFrontPage="true">Ericsson AB</organization>
            </author>
            <author initials="J" surname="Park" fullname="Jiye Park">
              <organization showOnFrontPage="true">Universitaet Duisburg-Essen</organization>
            </author>
            <date day="24" month="October" year="2022"/>
          </front>
          <seriesInfo name="Internet-Draft" value="draft-ietf-core-oscore-groupcomm-16"/>
          <refcontent>Work in Progress</refcontent>
        </reference>
        <reference anchor="RFC4998" target="https://www.rfc-editor.org/info/rfc4998" quoteTitle="true" derivedAnchor="RFC4998">
          <front>
            <title>Evidence Record Syntax (ERS)</title>
            <author fullname="T. Gondrom" initials="T." surname="Gondrom"/>
            <author fullname="R. Brandner" initials="R." surname="Brandner"/>
            <author fullname="U. Pordesch" initials="U." surname="Pordesch"/>
            <date month="August" year="2007"/>
            <abstract>
              <t indent="0">In many scenarios, users must be able prove the existence and integrity of data, including digitally signed data, in a common and reproducible way over a long and possibly undetermined period of time.  This document specifies the syntax and processing of an Evidence Record, a structure designed to support long-term non-repudiation of existence of data. [STANDARDS-TRACK]</t>
            </abstract>
          </front>
          <seriesInfo name="RFC" value="4998"/>
          <seriesInfo name="DOI" value="10.17487/RFC4998"/>
          <format target="https://www.rfc-editor.org/info/rfc4998" type="TXT"/>
        </reference>
        <reference anchor="RFC7252" target="https://www.rfc-editor.org/info/rfc7252" quoteTitle="true" derivedAnchor="RFC7252">
          <front>
            <title>The Constrained Application Protocol (CoAP)</title>
            <author fullname="Z. Shelby" initials="Z." surname="Shelby"/>
            <author fullname="K. Hartke" initials="K." surname="Hartke"/>
            <author fullname="C. Bormann" initials="C." surname="Bormann"/>
            <date month="June" year="2014"/>
            <abstract>
              <t indent="0">The Constrained Application Protocol (CoAP) is a specialized web transfer protocol for use with constrained nodes and constrained (e.g., low-power, lossy) networks. The nodes often have 8-bit microcontrollers with small amounts of ROM and RAM, while constrained networks such as IPv6 over Low-Power Wireless Personal Area Networks (6LoWPANs) often have high packet error rates and a typical throughput of 10s of kbit/s. The protocol is designed for machine- to-machine (M2M) applications such as smart energy and building automation.</t>
              <t indent="0">CoAP provides a request/response interaction model between application endpoints, supports built-in discovery of services and resources, and includes key concepts of the Web such as URIs and Internet media types. CoAP is designed to easily interface with HTTP for integration with the Web while meeting specialized requirements such as multicast support, very low overhead, and simplicity for constrained environments.</t>
            </abstract>
          </front>
          <seriesInfo name="RFC" value="7252"/>
          <seriesInfo name="DOI" value="10.17487/RFC7252"/>
          <format target="https://www.rfc-editor.org/info/rfc7252" type="TXT"/>
        </reference>
        <reference anchor="RFC8152" target="https://www.rfc-editor.org/info/rfc8152" quoteTitle="true" derivedAnchor="RFC8152">
          <front>
            <title>CBOR Object Signing and Encryption (COSE)</title>
            <author fullname="J. Schaad" initials="J." surname="Schaad"/>
            <date month="July" year="2017"/>
            <abstract>
              <t indent="0">Concise Binary Object Representation (CBOR) is a data format designed for small code size and small message size.  There is a need for the ability to have basic security services defined for this data format.  This document defines the CBOR Object Signing and Encryption (COSE) protocol.  This specification describes how to create and process signatures, message authentication codes, and encryption using CBOR for serialization.  This specification additionally describes how to represent cryptographic keys using CBOR.</t>
            </abstract>
          </front>
          <seriesInfo name="RFC" value="8152"/>
          <seriesInfo name="DOI" value="10.17487/RFC8152"/>
          <format target="https://www.rfc-editor.org/info/rfc8152" type="TXT"/>
        </reference>
        <reference anchor="RFC8610" target="https://www.rfc-editor.org/info/rfc8610" quoteTitle="true" derivedAnchor="RFC8610">
          <front>
            <title>Concise Data Definition Language (CDDL): A Notational Convention to Express Concise Binary Object Representation (CBOR) and JSON Data Structures</title>
            <author fullname="H. Birkholz" initials="H." surname="Birkholz"/>
            <author fullname="C. Vigano" initials="C." surname="Vigano"/>
            <author fullname="C. Bormann" initials="C." surname="Bormann"/>
            <date month="June" year="2019"/>
            <abstract>
              <t indent="0">This document proposes a notational convention to express Concise Binary Object Representation (CBOR) data structures (RFC 7049).  Its main goal is to provide an easy and unambiguous way to express structures for protocol messages and data formats that use CBOR or JSON.</t>
            </abstract>
          </front>
          <seriesInfo name="RFC" value="8610"/>
          <seriesInfo name="DOI" value="10.17487/RFC8610"/>
          <format target="https://www.rfc-editor.org/info/rfc8610" type="TXT"/>
        </reference>
        <reference anchor="RFC8613" target="https://www.rfc-editor.org/info/rfc8613" quoteTitle="true" derivedAnchor="RFC8613">
          <front>
            <title>Object Security for Constrained RESTful Environments (OSCORE)</title>
            <author fullname="G. Selander" initials="G." surname="Selander"/>
            <author fullname="J. Mattsson" initials="J." surname="Mattsson"/>
            <author fullname="F. Palombini" initials="F." surname="Palombini"/>
            <author fullname="L. Seitz" initials="L." surname="Seitz"/>
            <date month="July" year="2019"/>
            <abstract>
              <t indent="0">This document defines Object Security for Constrained RESTful Environments (OSCORE), a method for application-layer protection of the Constrained Application Protocol (CoAP), using CBOR Object Signing and Encryption (COSE). OSCORE provides end-to-end protection between endpoints communicating using CoAP or CoAP-mappable HTTP. OSCORE is designed for constrained nodes and networks supporting a range of proxy operations, including translation between different transport protocols.</t>
              <t indent="0">Although an optional functionality of CoAP, OSCORE alters CoAP options processing and IANA registration. Therefore, this document updates RFC 7252.</t>
            </abstract>
          </front>
          <seriesInfo name="RFC" value="8613"/>
          <seriesInfo name="DOI" value="10.17487/RFC8613"/>
          <format target="https://www.rfc-editor.org/info/rfc8613" type="TXT"/>
        </reference>
        <reference anchor="RFC8949" target="https://www.rfc-editor.org/info/rfc8949" quoteTitle="true" derivedAnchor="RFC8949">
          <front>
            <title>Concise Binary Object Representation (CBOR)</title>
            <author fullname="C. Bormann" initials="C." surname="Bormann"/>
            <author fullname="P. Hoffman" initials="P." surname="Hoffman"/>
            <date month="December" year="2020"/>
            <abstract>
              <t indent="0">The Concise Binary Object Representation (CBOR) is a data format whose design goals include the possibility of extremely small code size, fairly small message size, and extensibility without the need for version negotiation. These design goals make it different from earlier binary serializations such as ASN.1 and MessagePack.</t>
              <t indent="0">This document obsoletes RFC 7049, providing editorial improvements, new details, and errata fixes while keeping full compatibility with the interchange format of RFC 7049. It does not create a new version of the format.</t>
            </abstract>
          </front>
          <seriesInfo name="STD" value="94"/>
          <seriesInfo name="RFC" value="8949"/>
          <seriesInfo name="DOI" value="10.17487/RFC8949"/>
          <format target="https://www.rfc-editor.org/info/rfc8949" type="TXT"/>
        </reference>
        <referencegroup anchor="STD90" target="https://www.rfc-editor.org/info/std90" derivedAnchor="STD90">
          <reference anchor="RFC8259" target="https://www.rfc-editor.org/info/rfc8259" quoteTitle="true">
            <front>
              <title>The JavaScript Object Notation (JSON) Data Interchange Format</title>
              <author fullname="T. Bray" initials="T." role="editor" surname="Bray"/>
              <date month="December" year="2017"/>
              <abstract>
                <t indent="0">JavaScript Object Notation (JSON) is a lightweight, text-based, language-independent data interchange format. It was derived from the ECMAScript Programming Language Standard. JSON defines a small set of formatting rules for the portable representation of structured data.</t>
                <t indent="0">This document removes inconsistencies with other specifications of JSON, repairs specification errors, and offers experience-based interoperability guidance.</t>
              </abstract>
            </front>
            <seriesInfo name="STD" value="90"/>
            <seriesInfo name="RFC" value="8259"/>
            <seriesInfo name="DOI" value="10.17487/RFC8259"/>
            <format target="https://www.rfc-editor.org/info/rfc8259" type="TXT"/>
          </reference>
        </referencegroup>
      </references>
    </references>
    <section anchor="examples" numbered="true" removeInRFC="false" toc="include" pn="section-appendix.a">
      <name slugifiedName="name-examples">Examples</name>
      <t indent="0" pn="section-appendix.a-1">This appendix includes a set of examples that show the different features and message types that have been defined in this document.  To make the examples easier to read, they are presented using the extended CBOR diagnostic notation (defined in <xref target="RFC8610" format="default" sectionFormat="of" derivedContent="RFC8610"/>) rather than as a binary dump.
      </t>
      <t indent="0" pn="section-appendix.a-2">The examples are presented using the CBOR diagnostic notation.  A Ruby-based tool exists <xref target="CBORDIAG" format="default" sectionFormat="of" derivedContent="CBORDIAG"/> that can convert between the diagnostic notation and binary.  The referenced webpage includes installation instructions.
      </t>
      <t indent="0" pn="section-appendix.a-3">The diagnostic notation can be converted into binary files using the following command line:
      </t>
      <sourcecode type="" markers="false" pn="section-appendix.a-4">diag2cbor.rb &lt; inputfile &gt; outputfile
</sourcecode>
      <t indent="0" pn="section-appendix.a-5">The examples can be extracted from the XML version of this document via an XPath expression, as all of the sourcecode is tagged with the attribute 'type="cbor-diag"'.  (Depending on the XPath evaluator one is using, it may be necessary to deal with &amp;gt; as an entity.)</t>
      <sourcecode type="xpath" markers="false" pn="section-appendix.a-6">//sourcecode[@type='cbor-diag']/text()
</sourcecode>
      <t indent="0" pn="section-appendix.a-7">This appendix uses the following terms:</t>
      <dl newline="false" indent="3" spacing="normal" pn="section-appendix.a-8">
        <dt pn="section-appendix.a-8.1">AES-GCM:</dt>
        <dd pn="section-appendix.a-8.2">AES Galois/Counter Mode</dd>
        <dt pn="section-appendix.a-8.3">CEK:</dt>
        <dd pn="section-appendix.a-8.4">content-encryption key</dd>
        <dt pn="section-appendix.a-8.5">ECDH:</dt>
        <dd pn="section-appendix.a-8.6">Elliptic Curve Diffie-Hellman</dd>
        <dt pn="section-appendix.a-8.7">ECDH-ES:</dt>
        <dd pn="section-appendix.a-8.8">Elliptic Curve Diffie-Hellman Ephemeral Static</dd>
        <dt pn="section-appendix.a-8.9">ECDSA:</dt>
        <dd pn="section-appendix.a-8.10">Elliptic Curve Digital Signature Algorithm</dd>
        <dt pn="section-appendix.a-8.11">EdDSA:</dt>
        <dd pn="section-appendix.a-8.12">Edwards-curve Digital Signature Algorithm</dd>
        <dt pn="section-appendix.a-8.13">HKDF:</dt>
        <dd pn="section-appendix.a-8.14">HMAC-based Key Derivation Function</dd>
        <dt pn="section-appendix.a-8.15">HMAC:</dt>
        <dd pn="section-appendix.a-8.16">Hashed Message Authentication Code</dd>
      </dl>
      <section anchor="SignedExamples" numbered="true" removeInRFC="false" toc="include" pn="section-appendix.a.1">
        <name slugifiedName="name-examples-of-signed-messages">Examples of Signed Messages</name>
        <section anchor="Appendix_A_1_1" numbered="true" removeInRFC="false" toc="include" pn="section-appendix.a.1.1">
          <name slugifiedName="name-countersignature">Countersignature</name>
          <t indent="0" pn="section-appendix.a.1.1-1">This example uses the following:
          </t>
          <dl newline="false" indent="3" spacing="normal" pn="section-appendix.a.1.1-2">
            <dt pn="section-appendix.a.1.1-2.1">Signature Algorithm:</dt>
            <dd pn="section-appendix.a.1.1-2.2">ECDSA with SHA-256, Curve P-256</dd>
          </dl>
          <t indent="0" pn="section-appendix.a.1.1-3">The same header parameters are used for both the signature and the countersignature.</t>
          <t indent="0" pn="section-appendix.a.1.1-4">The size of the binary file is 180 bytes.</t>
          <sourcecode type="cbor-diag" markers="false" pn="section-appendix.a.1.1-5">
98(
  [
    / protected / h'',
    / unprotected / {
      / countersign / 11:[
        / protected  h'a10126' / &lt;&lt; {
            / alg / 1:-7 / ECDSA 256 /
          } &gt;&gt;,
        / unprotected / {
          / kid / 4: '11'
        },
        / signature / h'5ac05e289d5d0e1b0a7f048a5d2b643813ded50bc9e4
9220f4f7278f85f19d4a77d655c9d3b51e805a74b099e1e085aacd97fc29d72f887e
8802bb6650cceb2c'
      ]
    },
    / payload / 'This is the content.',
    / signatures / [
      [
        / protected h'a10126' / &lt;&lt; {
            / alg / 1:-7 / ECDSA 256 /
          } &gt;&gt;,
        / unprotected / {
          / kid / 4: '11'
        },
        / signature / h'e2aeafd40d69d19dfe6e52077c5d7ff4e408282cbefb
5d06cbf414af2e19d982ac45ac98b8544c908b4507de1e90b717c3d34816fe926a2b
98f53afd2fa0f30a'
      ]
    ]
  ]
)

</sourcecode>
        </section>
      </section>
      <section anchor="Signed1Examples" numbered="true" removeInRFC="false" toc="include" pn="section-appendix.a.2">
        <name slugifiedName="name-examples-of-signed1-message">Examples of Signed1 Messages</name>
        <section anchor="Appendix_B_2_3" numbered="true" removeInRFC="false" toc="include" pn="section-appendix.a.2.1">
          <name slugifiedName="name-countersignature-2">Countersignature</name>
          <t indent="0" pn="section-appendix.a.2.1-1">This example uses the following:
          </t>
          <dl newline="false" indent="3" spacing="normal" pn="section-appendix.a.2.1-2">
            <dt pn="section-appendix.a.2.1-2.1">Signature Algorithm:</dt>
            <dd pn="section-appendix.a.2.1-2.2">ECDSA with SHA-256, Curve P-256</dd>
            <dt pn="section-appendix.a.2.1-2.3">Countersignature Algorithm:</dt>
            <dd pn="section-appendix.a.2.1-2.4">ECDSA with SHA-512, Curve P-521</dd>
          </dl>
          <t indent="0" pn="section-appendix.a.2.1-3">The size of the binary file is 275 bytes.</t>
          <sourcecode type="cbor-diag" markers="false" pn="section-appendix.a.2.1-4">
18(
  [
    / protected h'A201260300' / &lt;&lt; {
      / alg / 1:-7, / ECDSA 256 /
      / ctyp / 3:0
    } &gt;&gt;,
    / unprotected / {
      / kid / 4: '11',
      / countersign / 11: [
        / protected h'A1013823' / &lt;&lt; {
          / alg / 1:-36 / ECDSA 512 /
        } &gt;&gt;,
        / unprotected / {
          / kid / 4: 'bilbo.baggins@hobbiton.example'
        },
        / signature / h'01B1291B0E60A79C459A4A9184A0D393E034B34AF069
A1CCA34F5A913AFFFF698002295FA9F8FCBFB6FDFF59132FC0C406E98754A98F1FBF
E81C03095F481856BC470170227206FA5BEE3C0431C56A66824E7AAF692985952E31
271434B2BA2E47A335C658B5E995AEB5D63CF2D0CED367D3E4CC8FFFD53B70D115BA
A9E86961FBD1A5CF'
      ]
    },
    / payload / 'This is the content.',
    / signature / h'BB587D6B15F47BFD54D2CBFCECEF75451E92B08A514BD439
FA3AA65C6AC92DF0D7328C4A47529B32ADD3DD1B4E940071C021E9A8F2641F1D8E3B
053DDD65AE52'
  ]
)
</sourcecode>
        </section>
      </section>
      <section anchor="EnvelopedExamples" numbered="true" removeInRFC="false" toc="include" pn="section-appendix.a.3">
        <name slugifiedName="name-examples-of-enveloped-messa">Examples of Enveloped Messages</name>
        <section anchor="Appendix_A_2_1" numbered="true" removeInRFC="false" toc="include" pn="section-appendix.a.3.1">
          <name slugifiedName="name-countersignature-on-encrypt">Countersignature on Encrypted Content</name>
          <t indent="0" pn="section-appendix.a.3.1-1">This example uses the following:
          </t>
          <dl newline="false" indent="3" spacing="normal" pn="section-appendix.a.3.1-2">
            <dt pn="section-appendix.a.3.1-2.1">CEK:</dt>
            <dd pn="section-appendix.a.3.1-2.2">AES-GCM with 128-bit key</dd>
            <dt pn="section-appendix.a.3.1-2.3">Recipient Class:</dt>
            <dd pn="section-appendix.a.3.1-2.4">ECDH Ephemeral-Static, Curve P-256</dd>
            <dt pn="section-appendix.a.3.1-2.5">Countersignature Algorithm:</dt>
            <dd pn="section-appendix.a.3.1-2.6">ECDSA with SHA-512, Curve P-521</dd>
          </dl>
          <t indent="0" pn="section-appendix.a.3.1-3">The size of the binary file is 326 bytes.</t>
          <sourcecode type="cbor-diag" markers="false" pn="section-appendix.a.3.1-4">
96(
  [
    / protected h'a10101' / &lt;&lt; {
        / alg / 1:1 / AES-GCM 128 /
      } &gt;&gt;,
    / unprotected / {
      / iv / 5:h'c9cf4df2fe6c632bf7886413',
      / countersign / 11:[
        / protected h'a1013823' / &lt;&lt; {
            / alg / 1:-36 / ES512 /
          } &gt;&gt;,
        / unprotected / {
          / kid / 4: 'bilbo.baggins@hobbiton.example'
        },
        / signature / h'00929663c8789bb28177ae28467e66377da12302d7f9
594d2999afa5dfa531294f8896f2b6cdf1740014f4c7f1a358e3a6cf57f4ed6fb02f
cf8f7aa989f5dfd07f0700a3a7d8f3c604ba70fa9411bd10c2591b483e1d2c31de00
3183e434d8fba18f17a4c7e3dfa003ac1cf3d30d44d2533c4989d3ac38c38b71481c
c3430c9d65e7ddff'
      ]
    },
    / ciphertext / h'7adbe2709ca818fb415f1e5df66f4e1a51053ba6d65a1a0
c52a357da7a644b8070a151b0',
    / recipients / [
      [
        / protected h'a1013818' / &lt;&lt; {
            / alg / 1:-25 / ECDH-ES + HKDF-256 /
          } &gt;&gt;,
        / unprotected / {
          / ephemeral / -1:{
            / kty / 1:2,
            / crv / -1:1,
            / x / -2:h'98f50a4ff6c05861c8860d13a638ea56c3f5ad7590bbf
bf054e1c7b4d91d6280',
            / y / -3:true
          },
          / kid / 4: 'meriadoc.brandybuck@buckland.example'
        },
        / ciphertext / h''
      ]
    ]
  ]
)

</sourcecode>
        </section>
      </section>
      <section anchor="EncryptExamples" numbered="true" removeInRFC="false" toc="include" pn="section-appendix.a.4">
        <name slugifiedName="name-examples-of-encrypted-messa">Examples of Encrypted Messages</name>
        <section anchor="Appendix_B_4_3" numbered="true" removeInRFC="false" toc="include" pn="section-appendix.a.4.1">
          <name slugifiedName="name-countersignature-on-encrypte">Countersignature on Encrypted Content</name>
          <t indent="0" pn="section-appendix.a.4.1-1">This example uses the following:
          </t>
          <dl newline="false" indent="3" spacing="normal" pn="section-appendix.a.4.1-2">
            <dt pn="section-appendix.a.4.1-2.1">CEK:</dt>
            <dd pn="section-appendix.a.4.1-2.2">AES-GCM with 128-bit key</dd>
            <dt pn="section-appendix.a.4.1-2.3">Countersignature Algorithm:</dt>
            <dd pn="section-appendix.a.4.1-2.4">EdDSA with Curve Ed25519</dd>
          </dl>
          <t indent="0" pn="section-appendix.a.4.1-3">The size of the binary file is 136 bytes.</t>
          <sourcecode type="cbor-diag" markers="false" pn="section-appendix.a.4.1-4">
16(
  [
    / protected h'A10101' / &lt;&lt; {
      / alg / 1:1 / AES-GCM 128 /
    } &gt;&gt;,
    / unprotected / {
      / iv / 5: h'02D1F7E6F26C43D4868D87CE',
      / countersign / 11: [
        / protected h'A10127' / &lt;&lt; {
          / alg / 1:-8 / EdDSA with Ed25519 /
        } &gt;&gt;,
        / unprotected / {
          / kid / 4: '11'
        },
        / signature / h'E10439154CC75C7A3A5391491F88651E0292FD0FE0E0
2CF740547EAF6677B4A4040B8ECA16DB592881262F77B14C1A086C02268B17171CA1
6BE4B8595F8C0A08'
      ]
    },
    / ciphertext / h'60973A94BB2898009EE52ECFD9AB1DD25867374B162E2C0
3568B41F57C3CC16F9166250A'
  ]
)
</sourcecode>
        </section>
      </section>
      <section anchor="MacExamples" numbered="true" removeInRFC="false" toc="include" pn="section-appendix.a.5">
        <name slugifiedName="name-examples-of-maced-messages">Examples of MACed Messages</name>
        <section anchor="Appendix_B_5_3" numbered="true" removeInRFC="false" toc="include" pn="section-appendix.a.5.1">
          <name slugifiedName="name-countersignature-on-mac-con">Countersignature on MAC Content</name>
          <t indent="0" pn="section-appendix.a.5.1-1">This example uses the following:
          </t>
          <dl newline="false" indent="3" spacing="normal" pn="section-appendix.a.5.1-2">
            <dt pn="section-appendix.a.5.1-2.1">MAC Algorithm:</dt>
            <dd pn="section-appendix.a.5.1-2.2">HMAC/SHA-256 with 256-bit key</dd>
            <dt pn="section-appendix.a.5.1-2.3">Countersignature Algorithm:</dt>
            <dd pn="section-appendix.a.5.1-2.4">EdDSA with Curve Ed25519</dd>
          </dl>
          <t indent="0" pn="section-appendix.a.5.1-3">The size of the binary file is 159 bytes.</t>
          <sourcecode type="cbor-diag" markers="false" pn="section-appendix.a.5.1-4">
97(
  [
    / protected h'A10105' / &lt;&lt; {
      / alg / 1:5 / HS256 /
    } &gt;&gt;,
    / unprotected / {
      / countersign / 11: [
        / protected h'A10127' / &lt;&lt; {
          / alg / 1:-8 / EdDSA /
        } &gt;&gt;,
        / unprotected / {
          / kid / 4: '11'
        },
        / signature / h'602566F4A311DC860740D2DF54D4864555E85BC036EA
5A6CF7905B96E499C5F66B01C4997F6A20C37C37543ADEA1D705347D38A5B13594B2
9583DD741F455101'
      ]
    },
    / payload / 'This is the content.',
    / tag / h'2BDCC89F058216B8A208DDC6D8B54AA91F48BD63484986565105C9
AD5A6682F6',
    / recipients / [
      [
        / protected / h'',
        / unprotected / {
          / alg / 1: -6, / direct /
          / kid / 4: 'our-secret'
        },
        / ciphertext / h''
      ]
    ]
  ]
)
</sourcecode>
        </section>
      </section>
      <section anchor="Mac0Examples" numbered="true" removeInRFC="false" toc="include" pn="section-appendix.a.6">
        <name slugifiedName="name-examples-of-mac0-messages">Examples of MAC0 Messages</name>
        <section anchor="Appendix_B_6_3" numbered="true" removeInRFC="false" toc="include" pn="section-appendix.a.6.1">
          <name slugifiedName="name-countersignature-on-mac0-co">Countersignature on MAC0 Content</name>
          <t indent="0" pn="section-appendix.a.6.1-1">This example uses the following:
          </t>
          <dl newline="false" indent="3" spacing="normal" pn="section-appendix.a.6.1-2">
            <dt pn="section-appendix.a.6.1-2.1">MAC Algorithm:</dt>
            <dd pn="section-appendix.a.6.1-2.2">HMAC/SHA-256 with 256-bit key</dd>
            <dt pn="section-appendix.a.6.1-2.3">Countersignature Algorithm:</dt>
            <dd pn="section-appendix.a.6.1-2.4">EdDSA with Curve Ed25519</dd>
          </dl>
          <t indent="0" pn="section-appendix.a.6.1-3">The size of the binary file is 159 bytes.</t>
          <sourcecode type="cbor-diag" markers="false" pn="section-appendix.a.6.1-4">
17(
  [
    / protected h'A10105' / &lt;&lt; {
      / alg / 1:5 / HS256 /
    } &gt;&gt;,
    / unprotected / {
      / countersign / 11: [
        / protected h'A10127' / &lt;&lt; {
          / alg / 1:-8 / EdDSA /
        } &gt;&gt;,
        / unprotected / {
          / kid / 4: '11'
        },
        / signature / h'968A315DF6B4F26362E11F4CFD2F2F4E76232F39657B
F1598837FF9332CDDD7581E248116549451F81EF823DA5974F885B681D3D6E38FC41
42D8F8E9E7DC8F0D'
      ]
    },
    / payload / 'This is the content.',
    / tag / h'A1A848D3471F9D61EE49018D244C824772F223AD4F935293F1789F
C3A08D8C58'
  ]
)
</sourcecode>
        </section>
      </section>
    </section>
    <section numbered="false" removeInRFC="false" toc="include" pn="section-appendix.b">
      <name slugifiedName="name-acknowledgments">Acknowledgments</name>
      <t indent="0" pn="section-appendix.b-1">This document is a product of the COSE Working Group of the IETF.</t>
      <t indent="0" pn="section-appendix.b-2">The initial draft version of the specification was based to some degree on the outputs of the JOSE and S/MIME Working Groups.</t>
      <t indent="0" pn="section-appendix.b-3"><contact fullname="Jim Schaad"/> passed on 3 October 2020.  This document is primarily his work.  <contact fullname="Russ Housley"/> served as the document editor after Jim's untimely death, mostly helping with the approval and publication processes.  Jim deserves all credit for the technical content.</t>
      <t indent="0" pn="section-appendix.b-4"><contact fullname="Jim Schaad"/> and <contact fullname="Jonathan Hammell"/> provided the examples in <xref target="examples" format="default" sectionFormat="of" derivedContent="Appendix A"/>.</t>
      <t indent="0" pn="section-appendix.b-5">The reviews by <contact fullname="Carsten Bormann"/>, <contact fullname="Ben Kaduk"/>, and <contact fullname="Elwyn Davies"/> greatly improved the clarity of the document.</t>
    </section>
    <section anchor="authors-addresses" numbered="false" removeInRFC="false" toc="include" pn="section-appendix.c">
      <name slugifiedName="name-authors-address">Author's Address</name>
      <author initials="J." surname="Schaad" fullname="Jim Schaad">
        <organization showOnFrontPage="true">August Cellars</organization>
        <address>
          <postal>
            <country>United States of America</country>
          </postal>
          <email/>
        </address>
      </author>
    </section>
  </back>
</rfc>
