Re: WebCrypto: JSON data encoding debate

On Mon, Mar 24, 2014 at 10:02 AM, Anne van Kesteren <annevk@annevk.nl>wrote:

> On Mon, Mar 24, 2014 at 4:47 PM, Alex Russell <slightlyoff@google.com>
> wrote:
> > From last week's meeting, it seems reasonable for us to consider the
> case of
> > binary UTF-8 JSON data being exposed as API:
> >
> >
> http://lists.w3.org/Archives/Public/public-webcrypto/2014Mar/0116.html
> >
> > To my design-nose, this smells. Thoughts?
>
> From reading that email it seems they are trying to move away from
> bytes into an ECMAScript object that can be serialized as JSON and
> used in various places.  That doesn't seem so bad?
>
>
Current spec: JSON Web Key is exposed as an ArrayBuffer of UTF-8.
Converting to/from JS objects (eg: JSON.parse/JSON.stringify) requires
round-tripping through the Encoding spec or, absent that, rolling your own.

Proposal: Expose JWK as JS objects. If you want an ArrayBuffer, round-trip
through Encoding spec.

Issues for the TAG:
1) Should the WG support both [individual reaction: No, seems like a really
bad design smell]
2) If the WG has to support one and only one, which one
  a) JSON-as-ArrayBuffer  [individual reaction: Seems antagonistic towards
developers for the common case]
  b) JSON-as-JSO

Obviously, I'm biased. However, hopefully the TAG can provide their input
and guidance on the design of this, because it's clear that there's no
progress being made in the WG on this issue. This is rather unfortunate,
but since much of the debate is on a matter of "design smells" (whether it
is or is not a smell to support the two methods simultaneously, whether it
is or is not a smell to require Encoding spec), the TAG seems uniquely
qualified to provide input.

Received on Monday, 24 March 2014 17:26:14 UTC