Subject: Re: [jose] JOSE top-level syntax proposal

From: "Jim Schaad" <[email-masked]>
Date: Sun, 3 Jun 2012 11:08:56 -0700

How would you extend this to deal with the alternative encoding format?
This only addresses the issue for the dot form of encoding.

Jim

> -----Original Message-----
> From: [email-masked] [mailto:[email-masked]] On Behalf Of
> Manger, James H
> Sent: Wednesday, May 30, 2012 5:56 PM
> To: [email-masked]
> Subject: [jose] JOSE top-level syntax proposal
> 
> Here is a concrete proposal for the syntax of JOSE messages that
explicitly
> indicates the mode of protection, independently of specific algorithm
values.
> 
> jwsec  = ("Z" "." header64 "." compressed64) /
>          ("S" "." header64 "." data64 "." signature64) /
>          ("I" "." header64 "." data64 "." checksum64) /
>          ("E" "." header64 "." enckey64 "." ciphertext64 "." mac64) /
>          (ext "." header64 *("." component64))
> 
> ext = 1*b64url ; future modes
> 
> header64 = 1*b64url ; base64url-encoded UTF-8-encoded JSON object
> 
> ; the following 8 items hold base64url-encoded byte arrays
> compressed64 = *b64url
> data64       = *b64url
> signature64  = *b64url
> checksum64   = *b64url
> enckey64     = *b64url
> ciphertext64 = *b64url
> mac64        = *b64url
> component64  = *b64url
> 
> b64url = %x41-5A / %x61-7A / %x30-39 / %x2D / %x5F
>           ; A-Z       a-z       0-9       -      _
> 
> Mode "Z" carries unsecured data that is optionally compressed.
> Mode "I" carries unsecured data with a checksum to detect accidental
errors.
> Mode "S" provide data origin authentication.
> Mode "E" provides confidentiality.
> 
> --
> James Manger
> 
> 
> _______________________________________________
> jose mailing list
> [email-masked]
> https://www.ietf.org/mailman/listinfo/jose

---

From: "Manger, James H" <[email-masked]>
Date: Mon, 4 Jun 2012 11:49:42 +1000

> > explicitly indicates the mode of protection, independently of
> > specific algorithm values.
> >

> This only addresses the issue for the dot form of encoding.

The current JWS-JS and JWE-JS alternative serializations still work. Where they talk about <header N contents> you could simply include the extra leading letter and dot. The JWE-JS example becomes:
{"headers":[
     "E.eyJhbG…In0",
     "E.eyJhbG…yJ9"],
 "encrypted_keys":[
     "TBD_encrypted_key_1_value_TBD",
     "TBD_encrypted_key_2_value_TBD"],
 "ciphertext":"TBD_ciphertext_value_TBD",
 "integrity_values":[
     "TBD_integrity_1_value_TBD",
     "TBD_integrity_2_value_TBD"]
}

Another alternative would be to keep the "headers", "encrypted_keys", "ciphertext", and "integrity_values" field as now, but add one new field "mode".
{
  "mode":"E",
  "headers":["eyJhbG…In0", "E.eyJhbG…yJ9"],
  "ciphertext":"…",
  "integrity_values":["…", "…"]
}

--
James Manger