JSON Canonicalization Scheme (JCS)
draft-rundgren-json-canonicalization-scheme-06

Document Type Active Internet-Draft (individual)
Last updated 2019-05-09
Stream (None)
Intended RFC status (None)
Formats plain text xml pdf html bibtex
Stream Stream state (No stream defined)
Consensus Boilerplate Unknown
RFC Editor Note (None)
IESG IESG state I-D Exists
Telechat date
Responsible AD (None)
Send notices to (None)
Network Working Group                                        A. Rundgren
Internet-Draft                                               Independent
Intended status: Standards Track                               B. Jordan
Expires: November 10, 2019                          Symantec Corporation
                                                              S. Erdtman
                                                              Spotify AB
                                                             May 9, 2019

                   JSON Canonicalization Scheme (JCS)
             draft-rundgren-json-canonicalization-scheme-06

Abstract

   Cryptographic operations like hashing and signing requires that the
   original data does not change during serialization or parsing.  One
   way addressing this issue is creating a canonical form of the data.
   Canonicalization also permits data to be exchanged in its original
   form on the "wire" while still being subject to secure cryptographic
   operations.  The JSON Canonicalization Scheme (JCS) provides
   canonicalization support for data in the JSON format by building on
   the strict serialization methods for JSON primitives defined by
   ECMAScript, constraining JSON data to the I-JSON subset, and through
   a deterministic property sorting scheme.

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 https://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 November 10, 2019.

Copyright Notice

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

Rundgren, et al.        Expires November 10, 2019               [Page 1]
Internet-Draft draft-rundgren-json-canonicalization-scheme      May 2019

   This document is subject to BCP 78 and the IETF Trust's Legal
   Provisions Relating to IETF Documents
   (https://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  . . . . . . . . . . . . . . . . . . . . . . . .   2
   2.  Terminology . . . . . . . . . . . . . . . . . . . . . . . . .   4
   3.  Detailed Operation  . . . . . . . . . . . . . . . . . . . . .   4
     3.1.  Creation of Input Data  . . . . . . . . . . . . . . . . .   4
     3.2.  Generation of Canonical JSON Data . . . . . . . . . . . .   5
       3.2.1.  Whitespace  . . . . . . . . . . . . . . . . . . . . .   5
       3.2.2.  Serialization of Primitive Data Types . . . . . . . .   5
         3.2.2.1.  Serialization of Literals . . . . . . . . . . . .   6
         3.2.2.2.  Serialization of Strings  . . . . . . . . . . . .   6
         3.2.2.3.  Serialization of Numbers  . . . . . . . . . . . .   6
       3.2.3.  Sorting of Object Properties  . . . . . . . . . . . .   7
       3.2.4.  UTF-8 Generation  . . . . . . . . . . . . . . . . . .   8
   4.  IANA Considerations . . . . . . . . . . . . . . . . . . . . .   9
   5.  Security Considerations . . . . . . . . . . . . . . . . . . .   9
   6.  Acknowledgements  . . . . . . . . . . . . . . . . . . . . . .   9
   7.  References  . . . . . . . . . . . . . . . . . . . . . . . . .   9
     7.1.  Normative References  . . . . . . . . . . . . . . . . . .   9
     7.2.  Informal References . . . . . . . . . . . . . . . . . . .  10
     7.3.  URIs  . . . . . . . . . . . . . . . . . . . . . . . . . .  11
   Appendix A.  ES6 Sample Canonicalizer . . . . . . . . . . . . . .  11
   Appendix B.  Number Serialization Samples . . . . . . . . . . . .  13
   Appendix C.  Canonicalized JSON as "Wire Format"  . . . . . . . .  14
   Appendix D.  Dealing with Big Numbers . . . . . . . . . . . . . .  15
   Appendix E.  String Subtype Handling  . . . . . . . . . . . . . .  16
     E.1.  Subtypes in Arrays  . . . . . . . . . . . . . . . . . . .  18
   Appendix F.  Implementation Guidelines  . . . . . . . . . . . . .  18
   Appendix G.  Open Source Implementations  . . . . . . . . . . . .  19
   Appendix H.  Other JSON Canonicalization Efforts  . . . . . . . .  19
   Appendix I.  Development Portal . . . . . . . . . . . . . . . . .  20
Show full document text