Re: [jose] Canonical JSON form

"Manger, James" <James.H.Manger@team.telstra.com> Thu, 11 October 2018 00:29 UTC

Return-Path: <James.H.Manger@team.telstra.com>
X-Original-To: jose@ietfa.amsl.com
Delivered-To: jose@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id D9D26130DD7 for <jose@ietfa.amsl.com>; Wed, 10 Oct 2018 17:29:34 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.6
X-Spam-Level:
X-Spam-Status: No, score=-2.6 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIMWL_WL_MED=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_LOW=-0.7, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=teamtelstra.onmicrosoft.com
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id K58AQ9_-HekV for <jose@ietfa.amsl.com>; Wed, 10 Oct 2018 17:29:32 -0700 (PDT)
Received: from ipxcvo.tcif.telstra.com.au (ipxcvo.tcif.telstra.com.au [203.35.135.208]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 6C490130DD3 for <jose@ietf.org>; Wed, 10 Oct 2018 17:29:31 -0700 (PDT)
X-IronPort-AV: E=Sophos;i="5.54,366,1534773600"; d="scan'208,217";a="150092556"
X-Amp-Result: SKIPPED(no attachment in message)
Received: from unknown (HELO ipcavi.tcif.telstra.com.au) ([10.97.217.200]) by ipocvi.tcif.telstra.com.au with ESMTP; 11 Oct 2018 11:29:28 +1100
Received: from wsmsg3753.srv.dir.telstra.com ([172.49.40.174]) by ipcavi.tcif.telstra.com.au with ESMTP; 11 Oct 2018 11:29:27 +1100
Received: from wsapp5870.srv.dir.telstra.com (10.75.139.12) by WSMSG3753.srv.dir.telstra.com (172.49.40.174) with Microsoft SMTP Server (TLS) id 8.3.485.1; Thu, 11 Oct 2018 11:29:26 +1100
Received: from wsapp5584.srv.dir.telstra.com (10.75.131.20) by wsapp5870.srv.dir.telstra.com (10.75.139.12) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Thu, 11 Oct 2018 11:29:25 +1100
Received: from AUS01-SY3-obe.outbound.protection.outlook.com (10.172.229.125) by wsapp5584.srv.dir.telstra.com (10.75.131.20) with Microsoft SMTP Server (TLS) id 15.0.1395.4 via Frontend Transport; Thu, 11 Oct 2018 11:29:25 +1100
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=teamtelstra.onmicrosoft.com; s=selector1-team-telstra-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=pCnWdgNFGrbf2SSxeu9/jcHJUZ1zXnsatQXu/qtR9pc=; b=L3SBi0lLRE26j4xZtHls3VUgPgrL0k1mLv1z/mbuK0zDthgsvqJnk9XeNyGxMCcBGAYwMI7yn0/x7JwQ1Cc+UdZuKpBzr0PMnENSX2GFmULe4oomY3wq5nEqugrfQuwly5aLwJwtYc1D9ubpiQkWPnwaoN44k3IfJqUIeett1x4=
Received: from MEAPR01MB3542.ausprd01.prod.outlook.com (52.134.216.9) by MEAPR01MB3783.ausprd01.prod.outlook.com (52.134.217.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1207.25; Thu, 11 Oct 2018 00:29:21 +0000
Received: from MEAPR01MB3542.ausprd01.prod.outlook.com ([fe80::4031:99ca:970e:721e]) by MEAPR01MB3542.ausprd01.prod.outlook.com ([fe80::4031:99ca:970e:721e%2]) with mapi id 15.20.1207.029; Thu, 11 Oct 2018 00:29:21 +0000
From: "Manger, James" <James.H.Manger@team.telstra.com>
To: Bret Jordan <jordan.ietf@gmail.com>, "jose@ietf.org" <jose@ietf.org>
Thread-Topic: [jose] Canonical JSON form
Thread-Index: AQHUYMwqAYQkrLnvnkK7c9D6N5x9MKUY2XsAgAAaOgCAAAPogIAAL5qAgAACeoCAAALkcA==
Date: Thu, 11 Oct 2018 00:29:21 +0000
Message-ID: <MEAPR01MB35428606C09BF315DE04CC79E5E10@MEAPR01MB3542.ausprd01.prod.outlook.com>
References: <12DD2F97-80C3-4606-9C6B-03F7A4BF19DE@gmail.com> <CAOASepNX4aYVmPWXyODn0E2Om_rimACPECqJBvZSOXVVd_p8LA@mail.gmail.com> <D21F3A95-0085-4DB7-A882-3496CC091B34@gmail.com> <CAOASepM=hB_k7Syqw4+b7L2vd6E_J0DSAAW0mHYdLExBZ6VBuw@mail.gmail.com> <00ad01d460f4$69ae8a00$3d0b9e00$@augustcellars.com> <8436AEE7-B25A-4538-B8F6-16D558D9A504@gmail.com>
In-Reply-To: <8436AEE7-B25A-4538-B8F6-16D558D9A504@gmail.com>
Accept-Language: en-AU, en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
dlp-product: dlpe-windows
dlp-version: 10.0.500.19
dlp-reaction: no-action
authentication-results: spf=none (sender IP is ) smtp.mailfrom=James.H.Manger@team.telstra.com;
x-originating-ip: [203.35.185.253]
x-ms-publictraffictype: Email
x-microsoft-exchange-diagnostics: 1; MEAPR01MB3783; 6:wqtdR58jnplPCvEtDfY5w/1Y4ywYs+KRsZlaxDX5MQ/Hajy1esxO1xhcfK5bqIn7nmZVFcgAnxQTJ4fW8xcAGcoJcSjN4edEhW8xy3P3rS/sYsw+Q9LsbT3rpNcRba20O1gD3JBLOwoePPnY7VXhBwqiAlKvZTE6HAZYRGXPABmrgKcmDSVNDfavSLohl5XESjWjk2rowU3LGtfQbj2m1OmykqdpLchmHUVupv3Gb04l+H2kOYSjpGjGfbiTms13/0HQ22LYE/lsBcmn5b7zuqIED876Q1KO0l4W7YK9dnuYuu6nhKKuEVsVvF0nV9Jt9IfClkzLhyBgvFqEKIJZqedzbpyz0pbf9md7xMXGodH1xSY3ponKkoYcDjp11mzYcYjxkExY+B4rBJlZiJnI27vDq0S3VOsPbCqdD99O4G7fsV00XyayLePoib80g5k2IcwsSPzcn1JSMZCcZWT8HA==; 5:1oOcxmyT0DUTVoABbRkIXaC5/Nj3/kzpz66BbGW5UHhbqj9Q9A5ZK9wucIeBAb75rs2gYPAWv8IxGVIrrw6XObdBz2kb/fkO++WlOQ4nRPFHPEhW0MOBFiQb2Q8uw/Mgh+CXm1UZ0BHnSkzIYskSLg/vGLwA3tR1oeniO9kvcrA=; 7:UQhtVIBP3tslxFKD+dDfJom5jh0vtMQHufdIfGE5Oc2N9zM/wv8iZHDD0RTqEttZItyjoCn/KLZAGB4r8UpNX4C0nFnIhqtoEMCRKtYe3nz5oprxUhjM+5hd2OTAH5QEM8RnOZFbQyboOVcZITsmQneoLkDbw7RmO4smx+wZu0LR4EWZC/QVnclcru0H+VR8VqlGijPF66oKxsCBVK9RzVk/72J0ZJgk67AInaA+s/FGfG5UqBz0EgV1j/I+gFxD
x-ms-exchange-antispam-srfa-diagnostics: SOS;
x-ms-office365-filtering-correlation-id: 7e40b1b6-e8f3-4c64-9f2d-08d62f1096bb
x-microsoft-antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(2017052603328)(7153060)(7193020); SRVR:MEAPR01MB3783;
x-ms-traffictypediagnostic: MEAPR01MB3783:
x-microsoft-antispam-prvs: <MEAPR01MB37832E2AD1713028412F3AC5E5E10@MEAPR01MB3783.ausprd01.prod.outlook.com>
x-exchange-antispam-report-test: UriScan:(21748063052155)(28532068793085)(190501279198761)(227612066756510);
x-ms-exchange-senderadcheck: 1
x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(3231355)(944501410)(52105095)(3002001)(93006095)(93001095)(10201501046)(149066)(150057)(6041310)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123558120)(20161123562045)(201708071742011)(7699051); SRVR:MEAPR01MB3783; BCL:0; PCL:0; RULEID:; SRVR:MEAPR01MB3783;
x-forefront-prvs: 08220FA8D6
x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(136003)(366004)(39860400002)(396003)(376002)(346002)(189003)(199004)(55016002)(39060400002)(6246003)(53936002)(236005)(71190400001)(9686003)(606006)(71200400001)(478600001)(25786009)(72206003)(54896002)(68736007)(3846002)(5250100002)(14454004)(66574009)(2501003)(966005)(86362001)(6116002)(790700001)(2900100001)(5660300001)(93886005)(7736002)(6506007)(26005)(14444005)(99286004)(256004)(6306002)(316002)(486006)(446003)(11346002)(33656002)(66066001)(53546011)(476003)(229853002)(106356001)(102836004)(81156014)(97736004)(6436002)(74316002)(105586002)(8676002)(2906002)(186003)(8936002)(7696005)(76176011)(81166006)(110136005); DIR:OUT; SFP:1102; SCL:1; SRVR:MEAPR01MB3783; H:MEAPR01MB3542.ausprd01.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:0;
received-spf: None (protection.outlook.com: team.telstra.com does not designate permitted sender hosts)
x-microsoft-antispam-message-info: khKhyI3P2B3b3urHMRHfGO0gDKZ/ohEdCOUUrh3nXjktQ3rMVEYk43gY/5MZRAQIfPP/ht90KV44UjUOLP+bCtB0REtbw1CrH3QSO40OVBYS8QOT1LfMrkhsLnPsHcJTm/ViJBtx3qjcB4V8x3MORSx/GXwfP27IHUcnagRPZ/uiPP2I07ysjbWvjbFmFygsGVNhLLAEnwEvJDrjmJot6ISLkTWtBF0DEljOyoA1Wn2I1NPAuo7j+iN172Z3Lv79AOEnnfAvPJddyjtI0ilyozDJFOMFRK4LlLXlEmsfKH6LFT1/XK7KgEXeVMPiaWvAGg6og7wICzPlgVoalo8rtAwo0sO2WqY5xBTCERyot7Y=
spamdiagnosticoutput: 1:99
spamdiagnosticmetadata: NSPM
Content-Type: multipart/alternative; boundary="_000_MEAPR01MB35428606C09BF315DE04CC79E5E10MEAPR01MB3542ausp_"
MIME-Version: 1.0
X-MS-Exchange-CrossTenant-Network-Message-Id: 7e40b1b6-e8f3-4c64-9f2d-08d62f1096bb
X-MS-Exchange-CrossTenant-originalarrivaltime: 11 Oct 2018 00:29:21.2983 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 49dfc6a3-5fb7-49f4-adea-c54e725bb854
X-MS-Exchange-Transport-CrossTenantHeadersStamped: MEAPR01MB3783
X-OriginatorOrg: team.telstra.com
Archived-At: <https://mailarchive.ietf.org/arch/msg/jose/kaWjoiwyHzDL5aZZiBOrlN5s56Y>
Subject: Re: [jose] Canonical JSON form
X-BeenThere: jose@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: Javascript Object Signing and Encryption <jose.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/jose>, <mailto:jose-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/jose/>
List-Post: <mailto:jose@ietf.org>
List-Help: <mailto:jose-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/jose>, <mailto:jose-request@ietf.org?subject=subscribe>
X-List-Received-Date: Thu, 11 Oct 2018 00:29:35 -0000

https://tools.ietf.org/html/draft-rundgren-json-canonicalization-scheme
is a decent attempt at JSON canonicalization (and an appendix lists a few other attempts).
This one sorts object members based on their UTF-16 encoding (without escapes), and assumes double precision floats is the model for numbers.

--
James Manger

From: jose [mailto:jose-bounces@ietf.org] On Behalf Of Bret Jordan
Sent: Thursday, 11 October 2018 11:02 AM
To: Jim Schaad <ietf@augustcellars.com>
Cc: Nathaniel McCallum <npmccallum@redhat.com>om>; jose@ietf.org
Subject: Re: [jose] Canonical JSON form


Other implementations say that you should preserver the order of the fields you read when serialized which is part of JSON for the browser implementations but not necessarily elsewhere.

Preserving order is hard.  Depending on your programming language you might be deserializing the content in to a struct or you may be using a map.

What I need is a way for individuals and organizations to be able to pass around and share JSON data and collaboratively work on that JSON data and sign the parts that they have done.



Thanks,
Bret
PGP Fingerprint: 63B4 FC53 680A 6B7D 1447  F2C0 74F8 ACAE 7415 0050
"Without cryptography vihv vivc ce xhrnrw, however, the only thing that can not be unscrambled is an egg."