<?xml version='1.0' encoding='utf-8'?>
<?xml-stylesheet type="text/xsl" href="rfc2629.xslt" ?>
<?rfc toc="yes"?>
<?rfc symrefs="yes"?>
<?rfc sortrefs="yes"?>
<?rfc comments="yes"?>
<rfc ipr="trust200902" docName="draft-schaad-cbor-content-01" category="info" version="3" submissionType="IETF">
  <front>
    <title>CMS Content Types for CBOR</title>
    <author initials="J." surname="Schaad" fullname="Jim Schaad">
      <organization>August Cellars</organization>
      <address>
        <email>ietf@augustcellars.com</email>
      </address>
    </author>
    <date/>
    <area>Security</area>
    <abstract>
      <t>
        CBOR is becoming a widely used method of doing content encoding.
        CMS is still a widely used method of doing message based security.
        This document defines a set of content types for CMS that hold CBOR content.
      </t>
    </abstract>
    <note removeInRFC="true">
      <name>Contributing to this document</name>
      <!-- RFC EDITOR - Please remove this note before publishing -->
      <t>
        The source for this draft is being maintained in GitHub.
        Suggested changes should be submitted as pull requests at TBD. <!-- <eref target="https://github.com/cose-wg/X509"/> -->
        Editorial changes can be managed in GitHub, but any substantial issues need to be discussed on the COSE mailing list.
      </t>
    </note>
  </front>
  <middle>
    <section>
      <name>Introduction</name>
      <t>
        CBOR <xref target="RFC7049"/> is a compact self describing binary encoding formation that is starting to be used in many different applications.
        One of the primary uses of CBOR is in the Internet of Things where the constrained nature means that having minimal size of encodings becomes very important.
        The use of the Cryptographic Message System (CMS) <xref target="RFC5652"/> is still one of the most common method for providing message based security, although in many cases the CBOR Object Signing and Encryption (COSE) <xref target="RFC8152"/> message based security system is starting to be used.
        Given that CBOR is going to be transported using CMS, it makes sense to define CMS content types for the purpose of denoting that the embedded content is CBOR.
        This document defines two new content types: CBOR Content Type and CBOR Sequence Content Type <xref target="I-D.ietf-cbor-sequence"/>.
      </t>
    </section>

    <section>
      <name>CBOR Content Type</name>
      <t>
        <xref target="RFC7049"/> defines an encoded CBOR item.
        This section defines a new content type for wrapping an encoded CBOR item in a CMS object.
      </t>
      
      <t>
        The following object identifier identifies the CBOR content type:
      </t>

      <artwork>
id-ct-cbor OBJECT IDENTIFIER ::= { iso(1) member-body(2) usa(840)
                rsadsi(113549) pkcs(1) pkcs9(9) smime(16) ct(1) TBD1 }
      </artwork>
      
      <t>
        The CBOR content type is intended to refer to a single object encoded using the CBOR encoding format <xref target="RFC7049"/>.
        Nothing is stated about the specific CBOR object that is included.
        CBOR can always be decoded to a tree as the encoding is self descriptive.
      </t>

      <t>
        The CBOR content type is intended to be encapsulated in the signed data and auth-enveloped data, but can be included in any CMS wrapper.
        It cannot be predicted if the compressed CMS encapsulation will provide compression as the content may be binary rather than text.
      </t>

      <t>
        <xref target="RFC7193"/> defined an optional parameter "innerContent" to allow for identification of what the inner content is for an application/cms media type.
        This document defines the string "cbor" as a new value that can be placed here when a CBOR content type is used.
      </t>
      
    </section>

    <section>
      <name>CBOR Sequence Content Type</name>
      <t>
        <xref target="I-D.ietf-cbor-sequence"/> defines a CBOR Sequence as a concatenation of zero or more CBOR objects.
        This section defines a new content type for wrapping a CBOR Sequence in a CMS object.
      </t>
      
      <t>
        The following object identifier identifies the CBOR Sequence content type:
      </t>
      <artwork>
id-ct-cborSequence OBJECT IDENTIFIER ::= { iso(1) member-body(2) usa(840)
        rsadsi(113549) pkcs(1) pkcs9(9) smime(16) ct(1) TBD2 }
      </artwork>
      <t>
        The CBOR Sequence content type is intended to refer to a sequence of objects encoded using the CBOR encoding format.
        The objects are concatenated without any markers delimiting the individual CBOR objects.
        Nothing is stated about the specific CBOR objects that are included.
        CBOR can always be decoded to a tree as the encoding is self descriptive.
      </t>

      <t>
        The CBOR Sequence content type is intended to be encapsulated in the signed data and auth-enveloped data, but can be included in any CMS wrapper.
        It cannot be predicted if the compressed CMS encapsulation will provide compression as the content may be binary rather than text.
      </t>

      <t>
        <xref target="RFC7193"/> defined an optional parameter "innerContent" to allow for identification of what the inner content is for an application/cms media type.
        This document defines the string "cborSequence" as a new value that can be placed here when a CBOR Sequence content type is used.
      </t>
    </section>

    <section>
      <name>ASN.1 Module</name>
      <artwork>
CborContentTypes { iso(1) member-body(2) usa(840)
        rsadsi(113549) pkcs(1) pkcs9(9) smime(16) 0 id-mod-cbor-2019(TBD3) }
DEFINITIONS EXPLICIT TAGS ::=
BEGIN
IMPORTS

    CONTENT-TYPE
    FROM  CryptographicMessageSyntax-2010
      { iso(1) member-body(2) us(840) rsadsi(113549)
         pkcs(1) pkcs-9(9) smime(16) modules(0) id-mod-cms-2009(58) }
    ;

    id-ct-cbor OBJECT IDENTIFIER ::= { iso(1) member-body(2)
        us(840) rsadsi(113549) pkcs(1) pkcs9(9) smime(16) ct(1) TBD1 }

    id-ct-cborSequence OBJECT IDENTIFIER ::= { iso(1) member-body(2)
        us(840) rsadsi(113549) pkcs(1) pkcs9(9) smime(16) ct(1) TBD2 }

    -- Content is encoded directly and does not have any ASN.1 structure
    ct-Cbor CONTENT-TYPE ::= { IDENTIFIED BY id-ct-cbor }

    -- Content is encoded directly and does not have any ASN.1 structure
    ct-CborSequence CONTENT-TYPE ::= { IDENTIFIED BY id-ct-cborSequence }

END
      </artwork>
    </section>

    <section>
      <name>IANA Considerations</name>
      <t>
        In the "SMI Security for S/MIME Module Identifier" registry, create a new entry to point to this document.
      </t>
      <table>
        <thead>
          <tr>
            <td>Decimal</td><td>Description</td><td>References</td>
          </tr>
        </thead>
        <tbody>
          <tr>
            <td>TBD3</td><td>id-mod-cbor-2019</td><td>[[This Document</td>
          </tr>
        </tbody>
      </table>

      <t>
        In the "SMI Security for S/MIME Content Types" registry, add two new entries for id-ct-cbor and id-ct-cborSequence that point to this document.
      </t>

      <table>
        <thead>
          <tr>
            <td>Decimal</td><td>Description</td><td>References</td>
          </tr>
        </thead>
        <tbody>
        <tr>
          <td>TBD1</td><td>id-ct-cbor</td><td>[[This Document]]</td>
        </tr>
        <tr>
          <td>TBD2</td><td>id-ct-cborSequence</td><td>[[This Document]]</td>
        </tr>
        </tbody>
      </table>

      <t>
        In the table "CMS Inner Content Types" add two new entries:
      </t>

      <table>
        <thead>
          <tr>
            <td>Name</td><td>Object Identifier</td><td>Reference</td>
          </tr>
        </thead>
        <tbody>
        <tr>
          <td>cbor</td><td>1.2.840.113549.1.9.16.1.TBD</td><td>[[This Document]]</td>
        </tr>
        <tr>
          <td>cborSequence</td><td>1.2.840.113549.1.9.16.1.TBD2</td><td>[[This Document]]</td>
        </tr>
        </tbody>
      </table>
    </section>

    <section>
      <name>Security Considerations</name>
      <t>
        This document only provides identification for content types, it does not introduce any new security issues by itself.
        The new content types does mean that id-data does not need to be used to identify these content types and thus can reduce confusion.
      </t>
    </section>
  </middle>
  <back>
    <displayreference target="RFC5652" to="CMS"/>
    <displayreference target="RFC7049" to="CBOR"/>
    <displayreference target="RFC8152" to="COSE"/>
    <displayreference target="I-D.ietf-cbor-sequence" to="CBOR-SEQ"/>
    
    <references>
      <name>Normative References</name>

      <?rfc include="reference.RFC.5652.xml" ?>
      <?rfc include="reference.RFC.7049.xml" ?>
      <?rfc include="reference.RFC.8152.xml" ?>
      <?rfc include="reference.RFC.7193.xml" ?>
      <?rfc include="reference.I-D.ietf-cbor-sequence.xml" ?>
    </references>
  </back>
</rfc>
        
    
