Subject: [jose] JOSE top-level syntax proposal

From: "Manger, James H" <[email-masked]>
Date: Thu, 31 May 2012 10:56:17 +1000

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