[jose] JWS in-object JS-signature sample

Anders Rundgren <anders.rundgren.net@gmail.com> Mon, 09 November 2015 15:43 UTC

Return-Path: <anders.rundgren.net@gmail.com>
X-Original-To: jose@ietfa.amsl.com
Delivered-To: jose@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id E6E3E1B2E03 for <jose@ietfa.amsl.com>; Mon, 9 Nov 2015 07:43:41 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2
X-Spam-Level:
X-Spam-Status: No, score=-2 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FROM=0.001, SPF_PASS=-0.001] autolearn=ham
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 hMYnQSp9FlRj for <jose@ietfa.amsl.com>; Mon, 9 Nov 2015 07:43:40 -0800 (PST)
Received: from mail-wm0-x22b.google.com (mail-wm0-x22b.google.com [IPv6:2a00:1450:400c:c09::22b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id EC1D51B2E66 for <jose@ietf.org>; Mon, 9 Nov 2015 07:43:39 -0800 (PST)
Received: by wmec201 with SMTP id c201so75729980wme.1 for <jose@ietf.org>; Mon, 09 Nov 2015 07:43:38 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:subject:to:message-id:date:user-agent:mime-version :content-type:content-transfer-encoding; bh=U9d82XSkduuyeF42TD8QR2jZq+kirbCe68KyjF5N3OI=; b=CyaOPVa0W1bSWpoT4Ngo69L0z+d3+LG8JNqQdQOtT0FqSbsYcvlu0mlJuoAD2xbTlU JnotVZgpWyeQiUDxGUCmVBjMQAG6OvkNPrX9XXTXU5le/ba4f9zjELSblmKeYCv9eij7 hNmFK5e+LxRXLo3V+v5qGcDmPpe9krWJT4D45P3wftkBLWyJBsd1q3L5yd4FXEAlxyOc s33l4Obqt5ewCX1I5y1A7AykqtOETtrJm5cfoRLAECa+DFfVds+uT3KfZLtvpvsc3NFs cPMtf2I55NMrd27orb4BR9W06ENFM9DY665PLbKNBkWC6EqemCjBz6dKDLA0ggpvSnhF 1sIA==
X-Received: by 10.194.71.16 with SMTP id q16mr29238130wju.49.1447083818542; Mon, 09 Nov 2015 07:43:38 -0800 (PST)
Received: from [192.168.1.79] (148.198.130.77.rev.sfr.net. [77.130.198.148]) by smtp.googlemail.com with ESMTPSA id 77sm14905635wml.20.2015.11.09.07.43.37 for <jose@ietf.org> (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 09 Nov 2015 07:43:37 -0800 (PST)
From: Anders Rundgren <anders.rundgren.net@gmail.com>
To: "jose@ietf.org" <jose@ietf.org>
Message-ID: <5640BF24.1030202@gmail.com>
Date: Mon, 09 Nov 2015 16:43:32 +0100
User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"; format="flowed"
Content-Transfer-Encoding: 7bit
Archived-At: <http://mailarchive.ietf.org/arch/msg/jose/s5TdEtfOdQ0z3Qmtij2yXemZW-A>
Subject: [jose] JWS in-object JS-signature sample
X-BeenThere: jose@ietf.org
X-Mailman-Version: 2.1.15
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: <https://mailarchive.ietf.org/arch/browse/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: Mon, 09 Nov 2015 15:43:42 -0000

A two-minute patch in my JSON package generated the following:

var reading =
{
   device: "Pump2",
   value: 13000,
   jws:
     {
       alg: "ES256",
       jwk:
         {
           kty: "EC",
           crv: "P-256",
           x: "8dymopMICY76wfnqdpX0JDpCRYke0-Jp1p7lKPQIIRg",
           y: "MfJhj722qkWnNiljFqRrVj8WStZVKoYQikmi5GopZwQ"
         },
       signature: "gkL_ktVEqnD8uQ5EnXKiasMx0xX6WjuTgMgUopPbYBIJTQmSAPSiHKQPNFKvAnfgVaBBCD1oXaygiuyq39iJLg"
     }
};

which reuses quite a bit of the JOSE vocabulary and is 100% algorithm compatible.

I'm personally in favor of rather using "signature" as place-holder but it certainly isn't a big deal.

Anders