<?xml version='1.0' encoding='UTF-8'?>

<?xml-stylesheet type='text/xsl' href='http://xml2rfc.tools.ietf.org/authoring/rfc2629.xslt' ?>
<!DOCTYPE rfc SYSTEM "rfc2629.dtd">

<?rfc toc="yes"?>
<?rfc tocompact="yes"?>
<?rfc tocdepth="4"?>
<?rfc tocindent="yes"?>
<?rfc symrefs="yes"?>
<?rfc sortrefs="yes"?>
<?rfc compact="yes"?>
<?rfc subcompact="no"?>

<rfc category="std" 
     ipr="trust200902" 
     docName="draft-jones-cbor-date-tag-01">
  <front>

    <title abbrev="CBOR Tag for Date">Concise Binary Object Representation (CBOR) Tags for Date</title>

    <author fullname="Michael B. Jones" surname="Jones" initials="M.B.">
      <organization>Microsoft</organization>
      <address>
	<email>mbj@microsoft.com</email>
	<uri>https://self-issued.info/</uri>
      </address>
    </author>

    <author fullname="Anthony Nadalin" initials="A." surname="Nadalin">
      <organization>Microsoft</organization>
      <address>
        <email>tonynad@microsoft.com</email>
      </address>
    </author>

    <author fullname="Jörg Richter" initials="J." surname="Richter">
      <organization>pdv Financial Software GmbH</organization>
      <address>
	<email>joerg.richter@pdv-fs.de</email>
      </address>
    </author>

    <date day="21" month="April" year="2020" />

    <area>Applications</area>
    <workgroup>CBOR Working Group</workgroup>

    <keyword>Compact Binary Object Representation</keyword>
    <keyword>CBOR</keyword>
    <keyword>Tag</keyword>
    <keyword>Date</keyword>
    <keyword>Internet-Draft</keyword>

    <abstract>
      <t>
	The Concise Binary Object Representation (CBOR, RFC 7049) 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.
      </t>
      <t>
	In CBOR, one point of extensibility is the definition of CBOR tags.
	RFC 7049 defines two tags for time:
	CBOR tag 0 (RFC 3339 date/time string)
	and tag 1 (Posix "seconds since the epoch").
	Since then, additional requirements have become known.
	This specification defines a CBOR tag for an RFC 3339 date text string,
	for applications needing a textual date representation without a time.
	It also defines a CBOR tag for days since the Posix epoch,
	for applicaitons needing a numeric date representation without a time.
	It is intended as the reference document for the IANA registration
	of the CBOR tags defined.
      </t>
    </abstract>
  </front>
  <middle>
    <section anchor="Introduction" title="Introduction">
      <t>
	The Concise Binary Object Representation (CBOR) <xref target="RFC7049"/>
	provides for the interchange of structured data
	without a requirement for a pre-agreed schema.
	RFC 7049 defines a basic set of data types, as well as a tagging mechanism
	that enables extending the set of data types supported via an IANA registry.
      </t>
      <t>
	This specification defines a CBOR tag for a text string representing a date but not a time.
	The tagged text string is represented as specified by the RFC 3339 <xref target="RFC3339"/>
	<spanx style="verb">full-date</spanx> production.
      </t>
      <t>
	This specification also defines a CBOR tag for an integer representing a date but not a time.
	The tagged integer is a positive or negative value indicating the number of days
	since the <xref target="POSIX.1">IEEE Std 1003.1, 2013 Edition</xref> epoch date 1970-01-01.
      </t>

      <section anchor="rnc" title="Requirements Notation and Conventions">
        <t>
	  The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
	  "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and
	  "OPTIONAL" in this document are to be interpreted as described in
	  BCP 14 <xref target="RFC2119"/> <xref target="RFC8174"/> when, and
	  only when, they appear in all capitals, as shown here.
	</t>
      </section>
    </section>

    <section anchor="IANA" title="IANA Considerations">

      <section anchor="cose-algorithms-registrations" title="Concise Binary Object Representation (CBOR) Tags Registrations">
        <t>
	  This section registers the following values in the
	  IANA "Concise Binary Object Representation (CBOR) Tags" registry <xref target="IANA.cbor-tags"/>.
	</t>
	<t>
	  <?rfc subcompact="yes"?>
	  <list style='symbols'>
	    <t>
	      Tag: 1004 (value requested)
	    </t>
	    <t>
	      Data Item: UTF-8 text string
	    </t>
	    <t>
	      Semantics: RFC 3339 full-date string
	    </t>
	    <t>
	      Reference: [[ this specification ]]
	    </t>
	  </list>
	</t>
	<t>
	  <list style='symbols'>
	    <t>
	      Tag: 100 (ASCII 'd') (value requested)
	    </t>
	    <t>
	      Data Item: Positive or negative integer
	    </t>
	    <t>
	      Semantics: Number of days since the epoch date 1970-01-01
	    </t>
	    <t>
	      Reference: [[ this specification ]]
	    </t>
	  </list>
	</t>
	<?rfc subcompact="no"?>
      </section>

    </section>

    <section anchor="Security" title="Security Considerations">
      <t>
	The security considerations of RFC 7049 apply; the tags introduced
	here are not expected to raise security considerations beyond those.
      </t>
      <t>
	A date, of course, has significant security considerations;
	these include the exploitation of ambiguities where the date is security relevant
	or where the date is used in access control decisions.
      </t>
    </section>

  </middle>

  <back>
    <references title="Normative References">

      <?rfc include="reference.RFC.2119.xml"?>
      <?rfc include="reference.RFC.3339.xml"?>
      <?rfc include="reference.RFC.7049.xml"?>
      <?rfc include="reference.RFC.8174.xml"?>

    </references>

    <references title="Informative References">

      <reference anchor="IANA.cbor-tags" target="http://www.iana.org/assignments/cbor-tags">
        <front>
          <title>Concise Binary Object Representation (CBOR) Tags</title>
          <author>
            <organization>IANA</organization>
          </author>
	  <date/>
        </front>
      </reference>

      <reference anchor="POSIX.1" target="http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap04.html#tag_04_15">
	<front>
	  <title>The Open Group Base Specifications Issue 7</title>
	  <author>
	    <organization>IEEE</organization>
	  </author>
	  <date year="2013"/>
	</front>
	<seriesInfo name="IEEE" value="Std 1003.1, 2013 Edition"/>
      </reference>

    </references>

    <section title="Acknowledgements" anchor="Acknowledgements" numbered="no">

      <t>
	Thanks to Carsten Bormann for supporting creation of this specification.
	Parts of the explanatory text in this specification come from draft-bormann-cbor-time-tag-02.
      </t>
    </section>

    <section title="Document History" anchor="History">
      <t>
        [[ to be removed by the RFC Editor before publication as an RFC ]]
      </t>

      <t>
        -01
        <list style='symbols'>
          <t>
	    Added tag for numeric date values relative to the Posix Epoch that was proposed by Jörg Richter.
          </t>
        </list>
      </t>

      <t>
        -00
        <list style='symbols'>
          <t>
	    Initial version.
          </t>
        </list>
      </t>

    </section>

  </back>
</rfc>
