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

Richard Barnes <rlb@ipv.sx> Wed, 06 February 2013 19:28 UTC

Return-Path: <rlb@ipv.sx>
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 025B421F8A68 for <jose@ietfa.amsl.com>; Wed, 6 Feb 2013 11:28:42 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -0.598
X-Spam-Level:
X-Spam-Status: No, score=-0.598 tagged_above=-999 required=5 tests=[AWL=-0.173, BAYES_00=-2.599, FH_RELAY_NODNS=1.451, FM_FORGED_GMAIL=0.622, HTML_MESSAGE=0.001, RDNS_NONE=0.1]
Received: from mail.ietf.org ([64.170.98.30]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id k9Rr9sOxNc3t for <jose@ietfa.amsl.com>; Wed, 6 Feb 2013 11:28:38 -0800 (PST)
Received: from mail-la0-x243.google.com (mail-la0-x243.google.com [IPv6:2a00:1450:4010:c03::243]) by ietfa.amsl.com (Postfix) with ESMTP id 0F5AB21F88E3 for <jose@ietf.org>; Wed, 6 Feb 2013 11:28:37 -0800 (PST)
Received: by mail-la0-f67.google.com with SMTP id fr10so266305lab.2 for <jose@ietf.org>; Wed, 06 Feb 2013 11:28:32 -0800 (PST)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:x-received:x-originating-ip:date:message-id:subject :from:to:content-type:x-gm-message-state; bh=F4JZIQUTXXm5AsUsspHFw1QzbrkLGsIfwHnRQ2+GZW4=; b=cMALbUuBVIOqTyC2/OW9raVHos1thwvr5qbNu9bLPeBsde13BYPijjeKVmktKE6Bsh f/+Eu1d4UQQDcZ9LLe4GLTBT5F8O13boCCirX5C97ZBIII/vqSsbZgnHLbC3yhbKTxpg ByhUmIGSh5tLJs8oljAgJwdgPoaXMYvTdEKfvoQS/Ixg8kcQDAx8t2+Cvz2MwwH6Xegl kuE5/fj8UGsW2qicc7jjmUjHYlP6nAShrOYCj5BzH8NbtU+4aykciFbG76pxYWyORvZJ V20d7GozcKfwlsSMBrdOSdzlK739NTgYNZX8Dtdu1Pbm9fSvF4ODTtSQD8qaLYr04SIv gMCQ==
MIME-Version: 1.0
X-Received: by 10.112.26.169 with SMTP id m9mr11904765lbg.116.1360178911917; Wed, 06 Feb 2013 11:28:31 -0800 (PST)
Received: by 10.112.147.164 with HTTP; Wed, 6 Feb 2013 11:28:31 -0800 (PST)
X-Originating-IP: [155.212.214.60]
Date: Wed, 06 Feb 2013 14:28:31 -0500
Message-ID: <CAL02cgQt8cj26KunfDvez+TBKgpvsdfN6Oe1XFTbkyWuSxPA9Q@mail.gmail.com>
From: Richard Barnes <rlb@ipv.sx>
To: jose@ietf.org
Content-Type: multipart/alternative; boundary="bcaec5555590e03b3d04d51354d5"
X-Gm-Message-State: ALoCoQnQnSV45W000iylKMb1IjFYJk5uu1ElGiNSI5ikLPzaToVD/adx3vsvm7YnM07gn2XZWKY0
Subject: [jose] A modest proposal for JSON-izing JW*
X-BeenThere: jose@ietf.org
X-Mailman-Version: 2.1.12
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: <http://www.ietf.org/mail-archive/web/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: Wed, 06 Feb 2013 19:28:42 -0000

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