[Rats] CDDL, CBOR and JSON for claims

Laurence Lundblade <lgl@island-resort.com> Thu, 09 May 2019 19:03 UTC

Return-Path: <lgl@island-resort.com>
X-Original-To: rats@ietfa.amsl.com
Delivered-To: rats@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id DAC6F120131 for <rats@ietfa.amsl.com>; Thu, 9 May 2019 12:03:43 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.899
X-Spam-Level:
X-Spam-Status: No, score=-1.899 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001] autolearn=ham autolearn_force=no
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 NUj_3dpGhPq5 for <rats@ietfa.amsl.com>; Thu, 9 May 2019 12:03:42 -0700 (PDT)
Received: from p3plsmtpa11-06.prod.phx3.secureserver.net (p3plsmtpa11-06.prod.phx3.secureserver.net [68.178.252.107]) (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 ECCE9120110 for <rats@ietf.org>; Thu, 9 May 2019 12:03:41 -0700 (PDT)
Received: from [192.168.1.82] ([76.192.164.238]) by :SMTPAUTH: with ESMTPSA id OoKRh568kyD5JOoKTh5Keg; Thu, 09 May 2019 12:03:41 -0700
From: Laurence Lundblade <lgl@island-resort.com>
Content-Type: multipart/alternative; boundary="Apple-Mail=_EE432439-0891-492A-80DF-8E23C9381100"
Mime-Version: 1.0 (Mac OS X Mail 11.5 \(3445.9.1\))
Message-Id: <D55151D8-2E14-477D-A072-C1D5140E8D4E@island-resort.com>
Date: Thu, 09 May 2019 12:03:39 -0700
To: "rats@ietf.org" <rats@ietf.org>
X-Mailer: Apple Mail (2.3445.9.1)
X-CMAE-Envelope: MS4wfMKO5u1tnK5puzwe8mPugsnp0ioScyYh0ZyXXwfMRyoqOxhVd7UIpe1eNOtF7mfn75Vl8I1q9QIWIAr6nKQryOa8/WZztyXqPfvkOYysTarEqBdxDbgX 3UmOhfsNiDYJmT6SbBQikWGKEZ5+d68TnBPeN+4074vbzlZ3ejaQHTyz
Archived-At: <https://mailarchive.ietf.org/arch/msg/rats/pv_mrXOqsLlqb7b1V1brb5sGcZM>
Subject: [Rats] CDDL, CBOR and JSON for claims
X-BeenThere: rats@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: Remote Attestation Procedures <rats.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/rats>, <mailto:rats-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/rats/>
List-Post: <mailto:rats@ietf.org>
List-Help: <mailto:rats-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/rats>, <mailto:rats-request@ietf.org?subject=subscribe>
X-List-Received-Date: Thu, 09 May 2019 19:03:44 -0000

I’ve just looked at the SenML RFC <https://tools.ietf.org/html/rfc8428> as something similar to what we are doing. It describes how to encode sensor measurements in JSON, CBOR, XML and EXI. It does not use CDDL. 

While interesting to see, I was thinking we would instead use CDDL to describe the information model for claims. There would be generic rules for encoding into CBOR and JSON. The CBOR rules are just standard CDDL. JSON would start with these rules are here in CDDL Appendix E <https://tools.ietf.org/html/draft-ietf-cbor-cddl-08#appendix-E>.

One thing I am inclined to take from SenML is the definition of both a string and integer name/label/key for each claim. The integer name/label/key is used with  CBOR when the most compactness is desired. The string name/label/key is used with JSON and can also be used with CBOR if more readable CBOR is desired.  CWT  does this too. 

I would restrict names/labels/keys the way CBOR does in section 1.4 <https://tools.ietf.org/html/rfc8152#section-1.4>: label = int / tstr

I would allow bstr for values in CDDL and specify that the are base64URL encoded when encoded for JSON. Also need to figure out how to handle dates and times.

Comments?

LL