Concise Binary Object Representation (CBOR)
draft-bormann-cbor-03

The information below is for an old version of the document
Document Type Active Internet-Draft (individual)
Last updated 2013-07-09
Stream (None)
Intended RFC status (None)
Formats plain text pdf html
Stream Stream state (No stream defined)
Document shepherd None
IESG IESG state I-D Exists
Telechat date
Responsible AD (None)
Send notices to (None)
not yet                                                       C. Bormann
Internet-Draft                                   Universitaet Bremen TZI
Intended status: Standards Track                              P. Hoffman
Expires: January 10, 2014                                 VPN Consortium
                                                           July 09, 2013

              Concise Binary Object Representation (CBOR)
                         draft-bormann-cbor-03

Abstract

   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.

Status of This Memo

   This Internet-Draft is submitted in full conformance with the
   provisions of BCP 78 and BCP 79.

   Internet-Drafts are working documents of the Internet Engineering
   Task Force (IETF).  Note that other groups may also distribute
   working documents as Internet-Drafts.  The list of current Internet-
   Drafts is at http://datatracker.ietf.org/drafts/current/.

   Internet-Drafts are draft documents valid for a maximum of six months
   and may be updated, replaced, or obsoleted by other documents at any
   time.  It is inappropriate to use Internet-Drafts as reference
   material or to cite them other than as "work in progress."

   This Internet-Draft will expire on January 10, 2014.

Copyright Notice

   Copyright (c) 2013 IETF Trust and the persons identified as the
   document authors.  All rights reserved.

Bormann & Hoffman       Expires January 10, 2014                [Page 1]
Internet-Draft                    CBOR                         July 2013

   This document is subject to BCP 78 and the IETF Trust's Legal
   Provisions Relating to IETF Documents
   (http://trustee.ietf.org/license-info) 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 Simplified BSD License text as described in Section 4.e of
   the Trust Legal Provisions and are provided without warranty as
   described in the Simplified BSD License.

Table of Contents

   1.  Introduction  . . . . . . . . . . . . . . . . . . . . . . . .   3
     1.1.  Objectives  . . . . . . . . . . . . . . . . . . . . . . .   3
     1.2.  Terminology . . . . . . . . . . . . . . . . . . . . . . .   5
   2.  Specification of the CBOR Encoding  . . . . . . . . . . . . .   6
     2.1.  Major Types . . . . . . . . . . . . . . . . . . . . . . .   6
     2.2.  Indefinite Lengths for Some Major Types . . . . . . . . .   8
     2.3.  Floating Point Numbers and Values with No Content . . . .  11
     2.4.  Optional Tagging of Items . . . . . . . . . . . . . . . .  12
       2.4.1.  Date and Time . . . . . . . . . . . . . . . . . . . .  14
       2.4.2.  Bignums . . . . . . . . . . . . . . . . . . . . . . .  14
       2.4.3.  Decimal Fractions and Bigfloats . . . . . . . . . . .  15
       2.4.4.  Content Hints . . . . . . . . . . . . . . . . . . . .  16
         2.4.4.1.  Encoded CBOR data item  . . . . . . . . . . . . .  16
         2.4.4.2.  Expected Later Encoding for CBOR to JSON
                   Converters  . . . . . . . . . . . . . . . . . . .  16
         2.4.4.3.  Encoded Text  . . . . . . . . . . . . . . . . . .  17
   3.  Creating CBOR-Based Protocols . . . . . . . . . . . . . . . .  17
     3.1.  CBOR in Streaming Applications  . . . . . . . . . . . . .  18
     3.2.  Parsing Errors  . . . . . . . . . . . . . . . . . . . . .  18
       3.2.1.  Enforcing Restrictions on the Value Following a Tag .  18
       3.2.2.  Handling Unknown Simple Values and Tags . . . . . . .  19
       3.2.3.  UTF-8 Strings . . . . . . . . . . . . . . . . . . . .  19
       3.2.4.  Incomplete CBOR data items  . . . . . . . . . . . . .  19
       3.2.5.  Unknown Additional Information Values . . . . . . . .  20
     3.3.  Numbers . . . . . . . . . . . . . . . . . . . . . . . . .  20
     3.4.  Specifying Keys for Maps  . . . . . . . . . . . . . . . .  20
     3.5.  Undefined Values  . . . . . . . . . . . . . . . . . . . .  21
     3.6.  Canonical CBOR  . . . . . . . . . . . . . . . . . . . . .  21
     3.7.  Generic Encoders and Parsers  . . . . . . . . . . . . . .  22
   4.  Converting Data Between CBOR and JSON . . . . . . . . . . . .  23
     4.1.  Converting From CBOR to JSON  . . . . . . . . . . . . . .  23
     4.2.  Converting From JSON to CBOR  . . . . . . . . . . . . . .  24
   5.  Future Evolution of CBOR  . . . . . . . . . . . . . . . . . .  25
     5.1.  Extension Points  . . . . . . . . . . . . . . . . . . . .  26
Show full document text