Re: [Ace] Transporting different types of cnf objects - CBOR vs JSON

Jim Schaad <> Tue, 04 June 2019 18:37 UTC

Return-Path: <>
Received: from localhost (localhost []) by (Postfix) with ESMTP id BBC2E120409 for <>; Tue, 4 Jun 2019 11:37:40 -0700 (PDT)
X-Virus-Scanned: amavisd-new at
X-Spam-Flag: NO
X-Spam-Score: -1.9
X-Spam-Status: No, score=-1.9 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
Received: from ([]) by localhost ( []) (amavisd-new, port 10024) with ESMTP id WDFtoXPZjOUA for <>; Tue, 4 Jun 2019 11:37:38 -0700 (PDT)
Received: from ( []) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by (Postfix) with ESMTPS id 516B4120407 for <>; Tue, 4 Jun 2019 11:37:38 -0700 (PDT)
Received: from Jude ( by ( with Microsoft SMTP Server (TLS) id 15.0.1395.4; Tue, 4 Jun 2019 11:37:31 -0700
From: Jim Schaad <>
To: 'Ludwig Seitz' <>, <>
References: <000201d51814$34a85fc0$9df91f40$> <>
In-Reply-To: <>
Date: Tue, 4 Jun 2019 11:37:30 -0700
Message-ID: <010901d51b04$92788a10$b7699e30$>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: quoted-printable
X-Mailer: Microsoft Outlook 16.0
Thread-Index: AQOBPTx051puaG/P5Kmni8/yltJpwgFLCqOYoykv4YA=
Content-Language: en-us
X-Originating-IP: []
Archived-At: <>
Subject: Re: [Ace] Transporting different types of cnf objects - CBOR vs JSON
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: "Authentication and Authorization for Constrained Environments \(ace\)" <>
List-Unsubscribe: <>, <>
List-Archive: <>
List-Post: <>
List-Help: <>
List-Subscribe: <>, <>
X-List-Received-Date: Tue, 04 Jun 2019 18:37:41 -0000

> -----Original Message-----
> From: Ace <>; On Behalf Of Ludwig Seitz
> Sent: Monday, June 3, 2019 11:51 PM
> To:
> Subject: Re: [Ace] Transporting different types of cnf objects - CBOR vs JSON
> On 01/06/2019 02:51, Jim Schaad wrote:
> > Ludwig,
> >
> > I have been doing some adaptions of my codebase for dealing with the
> > MQTT specification.  In the process of this, I have identified the
> > following items that I think needs some discussion.  They may not need
> > changes in any documents and maybe should get a new document.
> >
> > 1.  The MQTT document is using the content type "application/json"
> > over HTTPS for transporting messages.  Does there need to be an
> > "application/ace+json" defined as a media type, but not necessarily a
> > CBOR media type?  I think the answer may be yes, but it could be a new
> document.
> >
> I would argue that the first draft using such a media type would be the right
> place to specify it. However I'm not sure using JSON is the right approach for
> an ACE specification at all, aren't we supposed to cater for the constrained
> world?
> What is there to prevent us from transporting CBOR over HTTP?

There would be no reason that one cannot transport CBOR over HTTP.  During the discussions for these drafts Hannes was very explicit that he wanted to be able to use JSON rather than CBOR with the protocol that was defined by ACE.  This would mean that there needs to be an ability to use JSON with the ACE framework document.

I would have no problems with the statement that the MQTT document would be a good place to define the new media type.

> > 2.  If I use a "COSE_Key" confirmation method inside of an
> > application/ace+json message, there is a potential problem and it
> > could be dealt with in a number of different ways.
> > *  The JWT confirmation method is identified as "jwk".  The COSE key
> > must be translated into JOSE even if there is no equivalent key in
> > JOSE.  I.e. that is a fatal error
> > *  This does not make sense and the confirmation method should be
> > changed to "cwk" so that either key format could be used in either
> encoding.
> >
> If we use JSON messages mixing in COSE becomes awkward. If the use case
> calls for JSON, I'd argue it should also use RFC7800 instead of draft-ietf-ace-
> cwt-proof-of-possession.

I would not have a problem with this, it was one of the options above.  I was just expanding my code to allow for JSON to be used and ran into this.  I just wanted to get a clear group decision on this before I put things into stone.


> > 3.  If the confirmation is changed, you would need to convert the COSE
> > key to a binary string, base64 encoded it and pass as a string when
> > occurring in a JSON encoding.  There is not any other valid way to do
> > this (except see above of just converting the key format).  However,
> > the opposite of putting a JOSE key into a COSE confirmation has three
> > different options that could be used.
> > *  Encode the JOSE key to a string and pass as a string
> > *  Encode the JOSE key top level map as CBOR but leave all of the
> > elements alone.
> > *  Encode the JOSE key in CBOR including conversion of base64 strings
> > to binary data.
> > (My first preference is probably the second option, but either of the
> > first two make sense.)
> >
> > Jim
> >
> I'm still unsure that there is a good use case for transporting JOSE keys in
> CBOR, but if such a case turns up, I would agree that touching the encoding
> as little as possible is a good idea (=option 1 or 2).
> /Ludwig
> --
> Ludwig Seitz, PhD
> Security Lab, RISE
> Phone +46(0)70-349 92 51