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

The information below is for an old version of the document
Document Type Active Internet-Draft (individual in app area)
Last updated 2013-08-30
Stream IETF
Intended RFC status Proposed Standard
Formats plain text pdf html
Stream WG state (None)
Consensus Yes
Document shepherd John Levine
Shepherd write-up Show (last changed 2013-08-27)
IESG IESG state IESG Evaluation::AD Followup
Telechat date
Needs 4 more YES or NO OBJECTION positions to pass.
Responsible AD Barry Leiba
Send notices to draft-bormann-cbor@tools.ietf.org, johnl@iecc.com
IANA IANA review state Version Changed - Review Needed
IANA action state None
Network Working Group                                         C. Bormann
Internet-Draft                                   Universitaet Bremen TZI
Intended status: Standards Track                              P. Hoffman
Expires: March 03, 2014                                   VPN Consortium
                                                         August 30, 2013

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

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 March 03, 2014.

Copyright Notice

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

Bormann & Hoffman        Expires March 03, 2014                 [Page 1]
Internet-Draft                    CBOR                       August 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  . . . . . . . . . . . . . . . . . . . . . . .   4
     1.2.  Terminology . . . . . . . . . . . . . . . . . . . . . . .   5
   2.  Specification of the CBOR Encoding  . . . . . . . . . . . . .   6
     2.1.  Major Types . . . . . . . . . . . . . . . . . . . . . . .   7
     2.2.  Indefinite Lengths for Some Major Types . . . . . . . . .   9
     2.3.  Floating Point Numbers and Values with No Content . . . .  13
     2.4.  Optional Tagging of Items . . . . . . . . . . . . . . . .  14
       2.4.1.  Date and Time . . . . . . . . . . . . . . . . . . . .  16
       2.4.2.  Bignums . . . . . . . . . . . . . . . . . . . . . . .  16
       2.4.3.  Decimal Fractions and Bigfloats . . . . . . . . . . .  17
       2.4.4.  Content Hints . . . . . . . . . . . . . . . . . . . .  18
         2.4.4.1.  Encoded CBOR data item  . . . . . . . . . . . . .  18
         2.4.4.2.  Expected Later Encoding for CBOR to JSON
                   Converters  . . . . . . . . . . . . . . . . . . .  18
         2.4.4.3.  Encoded Text  . . . . . . . . . . . . . . . . . .  19
       2.4.5.  Self-describe CBOR  . . . . . . . . . . . . . . . . .  19
   3.  Creating CBOR-Based Protocols . . . . . . . . . . . . . . . .  20
     3.1.  CBOR in Streaming Applications  . . . . . . . . . . . . .  21
     3.2.  Generic Encoders and Decoders . . . . . . . . . . . . . .  21
     3.3.  Syntax Errors . . . . . . . . . . . . . . . . . . . . . .  22
       3.3.1.  Incomplete CBOR data items  . . . . . . . . . . . . .  22
       3.3.2.  Malformed Indefinite Length Items . . . . . . . . . .  23
       3.3.3.  Unknown Additional Information Values . . . . . . . .  23
     3.4.  Other Decoding Errors . . . . . . . . . . . . . . . . . .  23
     3.5.  Handling Unknown Simple Values and Tags . . . . . . . . .  24
     3.6.  Numbers . . . . . . . . . . . . . . . . . . . . . . . . .  24
     3.7.  Specifying Keys for Maps  . . . . . . . . . . . . . . . .  25
     3.8.  Undefined Values  . . . . . . . . . . . . . . . . . . . .  26
     3.9.  Canonical CBOR  . . . . . . . . . . . . . . . . . . . . .  26
     3.10. Strict Mode . . . . . . . . . . . . . . . . . . . . . . .  28
   4.  Converting Data Between CBOR and JSON . . . . . . . . . . . .  29
     4.1.  Converting From CBOR to JSON  . . . . . . . . . . . . . .  30
     4.2.  Converting From JSON to CBOR  . . . . . . . . . . . . . .  31
Show full document text