Subject: [jose] A modest proposal for JSON-izing JW*

From: Richard Barnes <[email-masked]>
Date: Wed, 6 Feb 2013 14:28:31 -0500

Dear JOSE,

tl;dr: Let's please add a simple JSON encoding to the base JW* specs.

I've been complaining for a while that the JW* documents aren't JSON, and
that the JSON serialization documents are too complex (because of the
integrity check issues).  So I thought it was about time that I made an
actual proposal for encoding the base JOSE object as JSON objects.  The
approach would be essentially the same as in the JSON serialization
documents, except with a focus on single objects.

JWE and JWS objects currently have the following form

jws = header.data.signature
jwe = header.key.iv.ciphertext.mac

The JSON encoding of a JWE/JWS would just take each of these Base64-encoded
pieces and assign them a name in a JSON structure.

jws = {
    "header": header,
    "data": data,
    "signature": signature
}

jwe = {
    "header": header,
    "key": key,
    "iv": iv,
    "data": ciphertext,
    "mac": mac
}

It seems to me that these encodings are simple enough that they could be
handled in a short section, in parallel to what I would call the "text
serialization" in the current documents.  So I would like to propose that
they be added to the base JWE and JWS documents.

Thanks,
--Richard

---

From: "Matt Miller (mamille2)" <[email-masked]>
Date: Wed, 6 Feb 2013 19:38:44 +0000

+1

- m&m

Matt Miller < [email-masked] >
Cisco Systems, Inc.

On Feb 6, 2013, at 12:28 PM, Richard Barnes <[email-masked]> wrote:

> _______________________________________________
> jose mailing list
> [email-masked]
> https://www.ietf.org/mailman/listinfo/jose

---

From: Mike Jones <[email-masked]>
Date: Wed, 6 Feb 2013 19:49:46 +0000

I'll note that these are nearly identical to the JSON Serialization encodings already specified in http://tools.ietf.org/html/draft-jones-jose-jws-json-serialization-04 and http://tools.ietf.org/html/draft-jones-jose-jwe-json-serialization-04, other than you're precluding multiple recipients.  The syntax:

     {"recipients":[
       {"header":"<header 1 contents>",
        "signature":"<signature 1 contents>"},
       ...
       {"header":"<header N contents>",
        "signature":"<signature N contents>"}],
      "payload":"<payload contents>"
     }

really isn't far from what you're proposing below.  It just has an array of per-recipient header fields, since accommodating multiple recipients is also a working group goal.

Once the rechartering is done, we'll have working group JSON serialization specifications.  It's a separate question whether to combine the compact and JSON serializations into the same document or to leave them separate.  The revised charter will allow us to do either.

                                                            -- Mike

From: [email-masked] [mailto:[email-masked]] On Behalf Of Richard Barnes
Sent: Wednesday, February 06, 2013 11:29 AM
To: [email-masked]
Subject: [jose] A modest proposal for JSON-izing JW*

Dear JOSE,

I've been complaining for a while that the JW* documents aren't JSON, and that the JSON serialization documents are too complex (because of the integrity check issues).  So I thought it was about time that I made an actual proposal for encoding the base JOSE object as JSON objects.  The approach would be essentially the same as in the JSON serialization documents, except with a focus on single objects.

The JSON encoding of a JWE/JWS would just take each of these Base64-encoded pieces and assign them a name in a JSON structure.

jws = {
    "header": header,
    "data": data,
    "signature": signature
}

jwe = {
    "header": header,
    "key": key,
    "iv": iv,
    "data": ciphertext,
    "mac": mac
}

It seems to me that these encodings are simple enough that they could be handled in a short section, in parallel to what I would call the "text serialization" in the current documents.  So I would like to propose that they be added to the base JWE and JWS documents.

Thanks,
--Richard

---

From: Richard Barnes <[email-masked]>
Date: Wed, 6 Feb 2013 15:23:35 -0500

No disagreement. The main proposal here is to put JSON into the base specs.
It's developer friendly, and compliant with the charter!

On Wed, Feb 6, 2013 at 2:49 PM, Mike Jones <[email-masked]>wrote:

>  I’ll note that these are nearly identical to the JSON Serialization
> encodings already specified in
> http://tools.ietf.org/html/draft-jones-jose-jws-json-serialization-04 and
> http://tools.ietf.org/html/draft-jones-jose-jwe-json-serialization-04,
> other than you’re precluding multiple recipients.  The syntax:****
>
> ** **
>
>      {"recipients":[****
>
>        {"header":"<header 1 contents>",****
>
>         "signature":"<signature 1 contents>"},****
>
>        ...****
>
>        {"header":"<header N contents>",****
>
>         "signature":"<signature N contents>"}],****
>
>       "payload":"<payload contents>"****
>
>      }****
>
> ** **
>
> really isn’t far from what you’re proposing below.  It just has an array
> of per-recipient header fields, since accommodating multiple recipients is
> also a working group goal.****
>
> ** **
>
> Once the rechartering is done, we’ll have working group JSON serialization
> specifications.  It’s a separate question whether to combine the compact
> and JSON serializations into the same document or to leave them separate.
> The revised charter will allow us to do either.****
>
> ** **
>
>                                                             -- Mike****
>
> ** **
>
> *From:* [email-masked] [mailto:[email-masked]] *On Behalf
> Of *Richard Barnes
> *Sent:* Wednesday, February 06, 2013 11:29 AM
> *To:* [email-masked]
> *Subject:* [jose] A modest proposal for JSON-izing JW*****
>
> ** **
>
> Dear JOSE,****
>
> ** **
>
> tl;dr: Let's please add a simple JSON encoding to the base JW* specs.****
>
> ** **
>
> documents, except with a focus on single objects.****
>
> ** **
>
> JWE and JWS objects currently have the following form****
>
> ** **
>
> jws = header.data.signature****
>
> jwe = header.key.iv.ciphertext.mac****
>
> ** **
>
> The JSON encoding of a JWE/JWS would just take each of these
> Base64-encoded pieces and assign them a name in a JSON structure.****
>
> ** **
>
> jws = {****
>
>     "header": header,****
>
>     "data": data,****
>
>     "signature": signature****
>
> }****
>
> ** **
>
> jwe = {****
>
>     "header": header,****
>
>     "key": key,****
>
>     "iv": iv,****
>
>     "data": ciphertext,****
>
>     "mac": mac****
>
> }****
>
> ** **
>
> they be added to the base JWE and JWS documents.****
>
> ** **
>
> Thanks,****
>
> --Richard****
>