draft-ietf-cbor-date-tag-03.txt   draft-ietf-cbor-date-tag-04.txt 
CBOR Working Group M. Jones CBOR Working Group M. Jones
Internet-Draft A. Nadalin Internet-Draft A. Nadalin
Intended status: Standards Track Microsoft Intended status: Standards Track Microsoft
Expires: January 2, 2021 J. Richter Expires: January 15, 2021 J. Richter
pdv Financial Software GmbH pdv Financial Software GmbH
July 1, 2020 July 14, 2020
Concise Binary Object Representation (CBOR) Tags for Date Concise Binary Object Representation (CBOR) Tags for Date
draft-ietf-cbor-date-tag-03 draft-ietf-cbor-date-tag-04
Abstract Abstract
The Concise Binary Object Representation (CBOR, RFC 7049) is a data The Concise Binary Object Representation (CBOR, RFC 7049) is a data
format whose design goals include the possibility of extremely small format whose design goals include the possibility of extremely small
code size, fairly small message size, and extensibility without the code size, fairly small message size, and extensibility without the
need for version negotiation. need for version negotiation.
In CBOR, one point of extensibility is the definition of CBOR tags. 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 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, string) and tag 1 (Posix "seconds since the epoch"). Since then,
additional requirements have become known. This specification additional requirements have become known. This specification
defines a CBOR tag for an RFC 3339 date text string, for applications defines a CBOR tag for an RFC 3339 date text string, for applications
needing a textual date representation without a time. It also needing a textual date representation within the Gregorian calendar
defines a CBOR tag for days since the Posix epoch, for applications without a time. It also defines a CBOR tag for days since the date
needing a numeric date representation without a time. These tags are 1970-01-01 in the Gregorian calendar for applications needing a
both for representations of calendar dates. It is intended as the numeric date representation without a time. It is intended as the
reference document for the IANA registration of the CBOR tags reference document for the IANA registration of the CBOR tags
defined. defined.
Status of This Memo Status of This Memo
This Internet-Draft is submitted in full conformance with the This Internet-Draft is submitted in full conformance with the
provisions of BCP 78 and BCP 79. provisions of BCP 78 and BCP 79.
Internet-Drafts are working documents of the Internet Engineering Internet-Drafts are working documents of the Internet Engineering
Task Force (IETF). Note that other groups may also distribute Task Force (IETF). Note that other groups may also distribute
working documents as Internet-Drafts. The list of current Internet- working documents as Internet-Drafts. The list of current Internet-
Drafts is at https://datatracker.ietf.org/drafts/current/. Drafts is at https://datatracker.ietf.org/drafts/current/.
Internet-Drafts are draft documents valid for a maximum of six months Internet-Drafts are draft documents valid for a maximum of six months
and may be updated, replaced, or obsoleted by other documents at any and may be updated, replaced, or obsoleted by other documents at any
time. It is inappropriate to use Internet-Drafts as reference time. It is inappropriate to use Internet-Drafts as reference
material or to cite them other than as "work in progress." material or to cite them other than as "work in progress."
This Internet-Draft will expire on January 2, 2021. This Internet-Draft will expire on January 15, 2021.
Copyright Notice Copyright Notice
Copyright (c) 2020 IETF Trust and the persons identified as the Copyright (c) 2020 IETF Trust and the persons identified as the
document authors. All rights reserved. document authors. All rights reserved.
This document is subject to BCP 78 and the IETF Trust's Legal This document is subject to BCP 78 and the IETF Trust's Legal
Provisions Relating to IETF Documents Provisions Relating to IETF Documents
(https://trustee.ietf.org/license-info) in effect on the date of (https://trustee.ietf.org/license-info) in effect on the date of
publication of this document. Please review these documents publication of this document. Please review these documents
carefully, as they describe your rights and restrictions with respect carefully, as they describe your rights and restrictions with respect
to this document. Code Components extracted from this document must to this document. Code Components extracted from this document must
include Simplified BSD License text as described in Section 4.e of include Simplified BSD License text as described in Section 4.e of
the Trust Legal Provisions and are provided without warranty as the Trust Legal Provisions and are provided without warranty as
described in the Simplified BSD License. described in the Simplified BSD License.
Table of Contents Table of Contents
1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2
1.1. Requirements Notation and Conventions . . . . . . . . . . 3 1.1. Calendar Dates . . . . . . . . . . . . . . . . . . . . . 3
2. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 3 1.2. Comparing Dates . . . . . . . . . . . . . . . . . . . . . 3
1.3. Comparing Dates and Times . . . . . . . . . . . . . . . . 3
2. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 4
2.1. Concise Binary Object Representation (CBOR) Tags 2.1. Concise Binary Object Representation (CBOR) Tags
Registrations . . . . . . . . . . . . . . . . . . . . . . 3 Registrations . . . . . . . . . . . . . . . . . . . . . . 4
3. Security Considerations . . . . . . . . . . . . . . . . . . . 3 3. Security Considerations . . . . . . . . . . . . . . . . . . . 4
4. References . . . . . . . . . . . . . . . . . . . . . . . . . 4 4. References . . . . . . . . . . . . . . . . . . . . . . . . . 4
4.1. Normative References . . . . . . . . . . . . . . . . . . 4 4.1. Normative References . . . . . . . . . . . . . . . . . . 4
4.2. Informative References . . . . . . . . . . . . . . . . . 4 4.2. Informative References . . . . . . . . . . . . . . . . . 5
Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . . 4 Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . . 5
Document History . . . . . . . . . . . . . . . . . . . . . . . . 4 Document History . . . . . . . . . . . . . . . . . . . . . . . . 5
Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 5 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 6
1. Introduction 1. Introduction
The Concise Binary Object Representation (CBOR) [RFC7049] provides The Concise Binary Object Representation (CBOR) [RFC7049] provides
for the interchange of structured data without a requirement for a for the interchange of structured data without a requirement for a
pre-agreed schema. RFC 7049 defines a basic set of data types, as 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 well as a tagging mechanism that enables extending the set of data
types supported via an IANA registry. types supported via an IANA registry.
This specification defines a CBOR tag for a text string representing This specification defines a CBOR tag for a text string representing
a date without a time. The tagged text string is represented as a date without a time. The tagged text string is represented as
specified by the RFC 3339 [RFC3339] "full-date" production. specified by the RFC 3339 [RFC3339] "full-date" production. Per RFC
3339, this represents a date within the Gregorian calendar.
This specification also defines a CBOR tag for an integer This specification also defines a CBOR tag for an integer
representing a date without a time. The tagged integer is an representing a date without a time. The tagged integer is an
unsigned or negative value indicating the number of days since the unsigned or negative value indicating the number of days since the
IEEE Std 1003.1, 2013 Edition [POSIX.1] epoch date 1970-01-01. As an Gregorian calendar date 1970-01-01. As an implementation note, this
implementation note, this value has a constant offset from the value has a constant offset from the Modified Julian Date value
Modified Julian Date value (which is defined by the Smithsonian (which is defined by the Smithsonian Astrophysical Observatory as the
Astrophysical Observatory as the number of days since November 17, number of days since November 17, 1858); this value is the Modified
1858); this value is the Modified Julian Date minus 40,587. Julian Date minus 40587.
Note that since both tags are for dates without times, time zones and Note that since both tags are for dates without times, times of day,
leap seconds are not applicable to these values. These tags are both time zones, and leap seconds are not applicable to these values.
for representations of calendar dates. These tags are both for representations of Gregorian calendar dates.
1.1. Requirements Notation and Conventions 1.1. Calendar Dates
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", Calendar dates are used for numerous human use cases, such as marking
"SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and the dates of significant events. For instance, John Lennon was born
"OPTIONAL" in this document are to be interpreted as described in BCP on October 9, 1940 and died on December 8, 1980. One such common use
14 [RFC2119] [RFC8174] when, and only when, they appear in all case is driver's licenses, which typically include a date of birth.
capitals, as shown here. The dates used in this specification use the Gregorian calendar, as
do those in RFC 3339 [RFC3339]. The time zones and actual times of
these events are intentionally not represented in the calendar date.
The epoch chosen for the second tag, which represents days since the
Gregorian calendar date 1970-01-01, is related to the IEEE Std
1003.1, 2013 Edition [POSIX.1] time epoch 1970-01-01T00:00:00Z UTC
only insofar as both contain the date 1970-01-01. This should not be
construed as indicating that dates using this tag represent either a
specific time of day and/or time zone.
The day of the week (Sunday, Monday, Tuesday, etc.) is not explicitly
represented in either of these date formats. However, deterministic
algorithms that are beyond the scope of this specification can be
used to derive the day of the week in the Gregorian calendar from
dates represented in both of these formats.
1.2. Comparing Dates
Comparison of dates in "full-date" format can be accomplished by
normal string comparison, since by design, the digits representing
the date are in fixed format and ordered from most significant to
least significant. Comparison of numeric dates representing days
since 1970-01-01 can be performed by normal integer comparison.
Comparison of dates in other formats or using other calendars require
conversions that are beyond the scope of this specification.
1.3. Comparing Dates and Times
Comparing dates with times is beyond the scope of this specification.
That said, if a date is augmented with a time zone and time of day,
comparing that augmented date with other times becomes possible. For
instance, if one were to augment John Lennon's birth date of October
9, 1940 with the time of day and time zone of his birth, then it
would be possible to derive a time at which he was born that could be
compared with other times.
2. IANA Considerations 2. IANA Considerations
2.1. Concise Binary Object Representation (CBOR) Tags Registrations 2.1. Concise Binary Object Representation (CBOR) Tags Registrations
This section registers the following values in the IANA "Concise This section registers the following values in the IANA "Concise
Binary Object Representation (CBOR) Tags" registry [IANA.cbor-tags]. Binary Object Representation (CBOR) Tags" registry [IANA.cbor-tags].
o Tag: 1004 (value requested) o Tag: 1004 (value requested)
o Data Item: UTF-8 text string o Data Item: UTF-8 text string
skipping to change at page 3, line 41 skipping to change at page 4, line 31
o Tag: 100 (ASCII 'd') (value requested) o Tag: 100 (ASCII 'd') (value requested)
o Data Item: Unsigned or negative integer o Data Item: Unsigned or negative integer
o Semantics: Number of days since the epoch date 1970-01-01 o Semantics: Number of days since the epoch date 1970-01-01
o Reference: [[ this specification ]] o Reference: [[ this specification ]]
3. Security Considerations 3. Security Considerations
The security considerations of RFC 7049 apply; the tags introduced The security considerations of RFC 7049 apply; the tags introduced
here are not expected to raise security considerations beyond those. here are not expected to raise security considerations beyond those.
A date, of course, has significant security considerations; these A date, of course, has significant security considerations. These
include the exploitation of ambiguities where the date is security include the exploitation of ambiguities where the date is security
relevant or where the date is used in access control decisions. When relevant or where the date is used in access control decisions.
using a calendar date for decision making, for example access
When using a calendar date for decision making, for example access
control, it needs to be noted that since calendar dates do not control, it needs to be noted that since calendar dates do not
represent a specific point in time, the results of the evaluation can represent a specific point in time, the results of the evaluation can
differ depending upon where the decision is made. For instance, a differ depending upon where the decision is made. For instance, a
person may have reached their 21st birthday in Japan while person may have reached their 21st birthday in Japan while
simultaneously being a day short of their 21st birthday in Hawaii. simultaneously being a day short of their 21st birthday in Hawaii.
4. References 4. References
4.1. Normative References 4.1. Normative References
[RFC2119] Bradner, S., "Key words for use in RFCs to Indicate
Requirement Levels", BCP 14, RFC 2119,
DOI 10.17487/RFC2119, March 1997,
<https://www.rfc-editor.org/info/rfc2119>.
[RFC3339] Klyne, G. and C. Newman, "Date and Time on the Internet: [RFC3339] Klyne, G. and C. Newman, "Date and Time on the Internet:
Timestamps", RFC 3339, DOI 10.17487/RFC3339, July 2002, Timestamps", RFC 3339, DOI 10.17487/RFC3339, July 2002,
<https://www.rfc-editor.org/info/rfc3339>. <https://www.rfc-editor.org/info/rfc3339>.
[RFC7049] Bormann, C. and P. Hoffman, "Concise Binary Object [RFC7049] Bormann, C. and P. Hoffman, "Concise Binary Object
Representation (CBOR)", RFC 7049, DOI 10.17487/RFC7049, Representation (CBOR)", RFC 7049, DOI 10.17487/RFC7049,
October 2013, <https://www.rfc-editor.org/info/rfc7049>. October 2013, <https://www.rfc-editor.org/info/rfc7049>.
[RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC
2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174,
May 2017, <https://www.rfc-editor.org/info/rfc8174>.
4.2. Informative References 4.2. Informative References
[IANA.cbor-tags] [IANA.cbor-tags]
IANA, "Concise Binary Object Representation (CBOR) Tags", IANA, "Concise Binary Object Representation (CBOR) Tags",
<http://www.iana.org/assignments/cbor-tags>. <http://www.iana.org/assignments/cbor-tags>.
[POSIX.1] IEEE, "The Open Group Base Specifications Issue 7", [POSIX.1] IEEE, "The Open Group Base Specifications Issue 7",
IEEE Std 1003.1, 2013 Edition, 2013, IEEE Std 1003.1, 2013 Edition, 2013,
<http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/ <http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/
V1_chap04.html#tag_04_15>. V1_chap04.html#tag_04_15>.
Acknowledgements Acknowledgements
Thanks to Carsten Bormann for supporting creation of this Thanks to Carsten Bormann for supporting creation of this
specification. Parts of the explanatory text in this specification specification. Parts of the explanatory text in this specification
come from draft-bormann-cbor-time-tag-02. come from draft-bormann-cbor-time-tag-02.
Thanks to these people for reviews of the specification: Henk Thanks to these people for reviews of the specification: Henk
Birkholz, Carsten Bormann, Thiago Macieira, Michael Richardson, Jim Birkholz, Carsten Bormann, Thiago Macieira, Francesca Palombini,
Schaad, Juergen Schoenwaelder, and Dale Worley. Michael Richardson, Jim Schaad, Juergen Schoenwaelder, and Dale
Worley.
Document History Document History
[[ to be removed by the RFC Editor before publication as an RFC ]] [[ to be removed by the RFC Editor before publication as an RFC ]]
-04
o Addressed shepherd comments by Francesca Palombini.
o Addressed additional review comments by Jim Schaad and Michael
Richardson.
-03 -03
o Added statement that these tags are both for representations of o Added statement that these tags are both for representations of
calendar dates. calendar dates.
o Described consequences of using calendar dates in access control o Described consequences of using calendar dates in access control
decisions. decisions.
-02 -02
o Addressed working group last call comments, including stating that o Addressed working group last call comments, including stating that
time zones are not applicable to these values. time zones are not applicable to these values.
-01 -01
o Changed "positive or negative" to "unsigned or negative". o Changed "positive or negative" to "unsigned or negative".
o Added an implementation note about the relationship to Modified o Added an implementation note about the relationship to Modified
Julian Dates. Julian Dates.
 End of changes. 21 change blocks. 
46 lines changed or deleted 84 lines changed or added

This html diff was produced by rfcdiff 1.47. The latest version is available from http://tools.ietf.org/tools/rfcdiff/