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

From: Kengo Suzuki <[email-masked]>
Date: Sun, 30 Sep 2018 02:01:26 +0900

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

---

From: "Manger, James" <[email-masked]>
Date: Sun, 30 Sep 2018 23:12:38 +0000

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:[email-masked]] On Behalf Of Kengo Suzuki
Sent: Sunday, 30 September 2018 3:01 AM
To: [email-masked]; [email-masked]
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<http://example.com/is_root%22:true>}

Thanks for your time

---

From: Kengo Suzuki <[email-masked]>
Date: Mon, 1 Oct 2018 08:35:27 +0900

I see.
Got it, thanks!

2018年10月1日(月) 8:12 Manger, James <[email-masked]>:

> 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*
>
>
>
>
>
>    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:[email-masked]] *On Behalf Of *Kengo Suzuki
> *Sent:* Sunday, 30 September 2018 3:01 AM
> *To:* [email-masked]; [email-masked]
> *Subject:* [jose] Base64 encoded JWS Payload Example seems wrong
>
>
>
> Hi
>
>
>
> This is Kengo Suzuki.
>