Concise Binary Object Representation (CBOR) Tags for Date
Extracted elements (16)
Tag 100's integer value has a constant offset from the Modified Julian Date (MJD): it equals the MJD minus 40587. This relationship is noted as an implementation aid but MJD is not part of the tag's normative definition.
The day of the week is not explicitly represented in either date format. Deterministic algorithms can derive it from both formats, but such derivation is out of scope for this specification.
The epoch 1970-01-01 chosen for tag 100 is related to the POSIX time epoch only in that both contain that date. It must not be construed as indicating that dates using this tag represent a specific time of day or time zone.
Times of day, time zones, and leap seconds are explicitly not applicable to either tag, because both tags are for date-only representations. This is a deliberate design choice separating date from datetime semantics.
Dates in tag 1004 'full-date' format can be compared by normal lexicographic string comparison because digits are in fixed format ordered from most to least significant. Numeric dates in tag 100 format can be compared by normal integer comparison.
Different dates may correspond to the same moment in time depending on the time zone in which the date was determined (e.g., Japan's Friday may simultaneously be Hawaii's Thursday). Comparing dates with date/time values is out of scope for this specification.
This specification extends RFC 7049 CBOR tag space, which already defines tag 0 (RFC 3339 date/time string) and tag 1 (POSIX seconds since epoch). Tags 1004 and 100 address the distinct need for date-only (no time) representations not covered by those existing tags.
The text string tagged with tag 1004 MUST be represented as specified by the RFC 3339 'full-date' production, representing a date within the Gregorian calendar.
CBOR tag 100 (ASCII 'd') is defined for an unsigned or negative integer representing the number of days since the Gregorian calendar date 1970-01-01. Negative values represent dates before the epoch.
CBOR tag 1004 is defined for a UTF-8 text string representing a calendar date without a time, formatted as an RFC 3339 'full-date' string (e.g., '1940-10-09'). This tag enables textual Gregorian calendar date representation in CBOR data items.
Two entries are registered in the IANA 'Concise Binary Object Representation (CBOR) Tags' registry: tag 1004 (UTF-8 text string; RFC 3339 full-date string) and tag 100 (unsigned or negative integer; number of days since epoch date 1970-01-01).
Calendar dates do not represent a specific point in time, so using a date for access control decisions can produce different results depending on where the decision is made (e.g., a person may have reached their 21st birthday in Japan while still being a day short in Hawaii).
It is inappropriate to use only a date to trigger certificate expiration, since a calendar date corresponds to a range of times worldwide rather than a specific, geography-independent point in time.
The security considerations of RFC 7049 (CBOR) apply to these tags. Additional risks arise from exploitation of date ambiguities where dates are security-relevant or used in access control decisions.
Tag 100 wraps an unsigned or negative integer data item. The integer encodes days since 1970-01-01; for example, October 9, 1940 is -10676 and December 8, 1980 is 3994.
Tag 1004 wraps a UTF-8 text string data item. The string MUST conform to the RFC 3339 'full-date' production (YYYY-MM-DD), encoding a Gregorian calendar date with no time or timezone component.