Re: [jose] Base64 encoded JWS Payload Example seems wrong

Kengo Suzuki <kengoscal@gmail.com> Sun, 30 September 2018 23:35 UTC

Return-Path: <kengoscal@gmail.com>
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 33FDD129AB8 for <jose@ietfa.amsl.com>; Sun, 30 Sep 2018 16:35:42 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.999
X-Spam-Level:
X-Spam-Status: No, score=-1.999 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, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com
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 6XYqkz0S7Www for <jose@ietfa.amsl.com>; Sun, 30 Sep 2018 16:35:40 -0700 (PDT)
Received: from mail-it1-x12c.google.com (mail-it1-x12c.google.com [IPv6:2607:f8b0:4864:20::12c]) (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 DB7AC128BAC for <jose@ietf.org>; Sun, 30 Sep 2018 16:35:39 -0700 (PDT)
Received: by mail-it1-x12c.google.com with SMTP id c85-v6so9102043itd.1 for <jose@ietf.org>; Sun, 30 Sep 2018 16:35:39 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=qxk5XwnrXgKfp8OohImaHvCx5NcDz+5ncNhckez/cXI=; b=EotRk2YTo34hGsTNNYB98mPPeSMW+BnYE+h+5QfHXXlRe0TKehcnrxX5Y1p7XauNEZ OR/a9cQyaUehGhgvH6UuOfnBPKeNxMeaD7VpiLR0rQblUQGLxXYq9vLN3Yngm5wroOEJ mWuhjBD5ZjRUaXHAJ5nwapipMJpWF8vLe2K1ZEgf1thn5GT6/2+HI+8liwRAwvtXNVVo VxijqZtpzLc0E1l9KqJiPqrV91wl8Ts3MflXpgupLFa0uWNqxDJXZqMzAKAYSQwcZPH9 fXhXC+GQ5/raUqG0McdRzT4Aat64yrFc0VXNqIiP/4CleBd5ogWf9aeuUB4V8ONebilF kwpQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=qxk5XwnrXgKfp8OohImaHvCx5NcDz+5ncNhckez/cXI=; b=mZYDV+xBcCiNTa+YOrDNzHZcGABJ33+kMX8WrjnQFsPB56DdlWxsGJ6E7+Di4u7OPE ytDGazq9h2a9F8FEEoL6kpAJsrPZavlR5rctIsAcfuftjCs9HMmJ9FkTt5XK4dxHzbx0 MHBd1oDShroaPs/H5gYu0edtmVCUyk5/yESXN00jBvhEEIwefsJN29Y995d0jgdBH7pz xBhEUFxjsTbAkhm88CAhR3SbDixWovEjmpZrUVhTvkm7f92RqsKooxpQtc9FV4V0Vj8g U+jZI4W2052FYL66NubV+4eMMcVYh2p8bg65YahkZgcdArMz43EV6VHmJgbDaUdfCB7f XWVw==
X-Gm-Message-State: ABuFfojniwbW+u2x7OD4y0ukkhpoFDE9IcX+1/Qkfwr2W94ZzOR6F7ym RJYnCqk35Oo3VJWkGYT0nx6cuKWy0D1vXUuE4hc=
X-Google-Smtp-Source: ACcGV617eWFQDDO60mfCkpNwOb59O0nVJDevNjg2L44HHvbRCvnGHWSzrYfhTGSkMiGLjMB+KI72hcepO//Vg9dmyvc=
X-Received: by 2002:a24:3fc6:: with SMTP id d189-v6mr8097071ita.64.1538350539100; Sun, 30 Sep 2018 16:35:39 -0700 (PDT)
MIME-Version: 1.0
References: <CA+CobDwudE+GmxJT5SLFchnattwiejExwv0G18gNxiYG0pOjJQ@mail.gmail.com> <MEAPR01MB354208CDB978D06A5182AB60E5EE0@MEAPR01MB3542.ausprd01.prod.outlook.com>
In-Reply-To: <MEAPR01MB354208CDB978D06A5182AB60E5EE0@MEAPR01MB3542.ausprd01.prod.outlook.com>
From: Kengo Suzuki <kengoscal@gmail.com>
Date: Mon, 01 Oct 2018 08:35:27 +0900
Message-ID: <CA+CobDykshfScoxUT5zm67NHKtA5AuZa4MVSdFY+xEtXnH4FNw@mail.gmail.com>
To: "Manger, James" <James.H.Manger@team.telstra.com>
Cc: "jose@ietf.org" <jose@ietf.org>
Content-Type: multipart/alternative; boundary="0000000000006c575a05771f25f6"
Archived-At: <https://mailarchive.ietf.org/arch/msg/jose/QQ079X89sbTOL2CY8CsBuz1_y7o>
X-Mailman-Approved-At: Sun, 30 Sep 2018 16:49:09 -0700
Subject: Re: [jose] Base64 encoded JWS Payload Example seems wrong
X-BeenThere: jose@ietf.org
X-Mailman-Version: 2.1.29
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: Sun, 30 Sep 2018 23:35:42 -0000

I see.
Got it, thanks!

2018年10月1日(月) 8:12 Manger, James <James.H.Manger@team.telstra.com>:

> You don’t have to eliminate CR LF. The point of sending the
> base64url-encoding is so the other end can get back the exact bytes,
> without having to define a single canonical JSON encoding. Any valid JSON
> encoding will do.
>
>
>
>
>
> *3* <https://tools.ietf.org/html/rfc7515#section-3>*.  JSON Web Signature
> (JWS) Overview*
>
>
>
>
>
>    JWS represents digitally signed or MACed content using JSON data
>
>    structures and base64url encoding.  These JSON data structures MAY
>
>    contain whitespace and/or line breaks before or after any JSON values
>
>    or structural characters, in accordance with Section 2 of RFC 7159
> <https://tools.ietf.org/html/rfc7159#section-2>
>
>    [RFC7159 <https://tools.ietf.org/html/rfc7159>].
>
>
>
>
>
>
>
>
>
> --
>
> James Manger
>
>
>
> *From:* jose [mailto:jose-bounces@ietf.org] *On Behalf Of *Kengo Suzuki
> *Sent:* Sunday, 30 September 2018 3:01 AM
> *To:* jose@ietf.org; draft-ietf-jose-json-web-signature@ietf.org
> *Subject:* [jose] Base64 encoded JWS Payload Example seems wrong
>
>
>
> Hi
>
>
>
> This is Kengo Suzuki.
>
> I was just reading https://tools.ietf.org/html/rfc7515#section-3.3 and
> tried to verify my own code using the following sample as JWS Payload.
>
>
>
>  {"iss":"joe","exp":1300819380,"http://example.com/is_root":true}
>
>
>
> The draft says the base64 encoded value will be "
>
> eyJpc3MiOiJqb2UiLA0KICJleHAiOjEzMDA4MTkzODAsDQogImh0dHA6Ly9leGFtcGxlLmNvbS9pc19yb290Ijp0cnVlfQ",
>
> but I think the value you have provided seems forgettign to eliminate CR and LF.
>
>
>
> I will post my sample codes in Golang.
>
> https://play.golang.org/p/FivX_83glex
>
>
>
> Thanks for your time
>
>
>
>