You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: draft-ietf-jose-json-web-proof.md
+30-8Lines changed: 30 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -425,28 +425,40 @@ The algorithm is responsible for representing selective disclosure of payloads i
425
425
426
426
Each disclosed payload MUST be base64url encoded when preparing it to be serialized. The headers and proof are also individually base64url encoded.
427
427
428
-
Like JWS, JWP supports both a Compact Serialization and a JSON Serialization.
428
+
Like JWS, JWP supports both a Compact Serialization and a JSON Serialization. These serializations both represent the same JSON-based header, payload and proof, and are thus interchangeable without breaking the proof value.
429
429
430
430
## Compact Serialization {#CompactSerialization}
431
431
432
-
The individually encoded payloads are concatenated with the `~` character to form an ordered delimited array. Any non-disclosed payloads are left blank, resulting in sequential `~~` characters such that all payload positions are preserved.
432
+
The compact serialiation provides a space-efficient encoding of a JWP in URL-safe characters. In addition to the alphabet of unpadded BASE64 URL-safe encoding, it uses the "." and "~" characters as separators.
433
433
434
-
A payload which is disclosed but which contains no data (i.e. a zero-length octet string) is encoded as a single `_` character of data, which is not a valid result from base64url-encoding a value.
434
+
All binary data is BASE64URL encoded, including the octets of the UTF-8 encoded headers and the individual payloads and proof values.
435
435
436
-
Additionally, an algorithm MAY supply multiple octet strings for a proof. These are concatenated with the `~` character to form an ordered delimited array.
436
+
Payloads and proofs are each concatenated into a single text form by concatenating the BASE64URL encoded values using the `~` character.
437
437
438
-
The headers, concatenated payloads, and proof value are then concatenated with a `.` character to form the final compact serialization. The issued form will only contain one header and always have three `.` separated parts. The presented form will always have four `.` separated parts, the issued header, followed by the protected header, then the payloads and the proof.
438
+
Individual payloads are allowed to be omitted; if a payload is omitted, it is represented as a zero-length text value, potentially resulting in leading, trailing, or consecutive `~` characters in the concatenated form.
439
+
440
+
If a payload or proof value was a zero-length octet string, it does not get output as its zero-length BASE64URL-encoded form but as a single `_` character. This character does not represent a valid BASE64URL-encoded octet string, allowing it to be distinguished from normally encoded data.
441
+
442
+
The issued form is created by concatenating the base64url-encoded issuer protected header, concatenated payloads, and concatenated proof separated each by a `.` character. The concatenated payloads MAY be omitted if the application is using detached payloads.
443
+
444
+
The presented form is created by concatenating the base64url-encoded presenter protected header, base64url-encoded issuer protected header, concatenated payloads, and concatenated proof separated each by a `.` character. The concatenated payloads MAY be omitted if the application is using detached payloads.
Non-disclosed payloads in the JSON serialization are represented with a `null` value in the `payloads` array. A zero-length payload is represented as a zero-length base64url encoded sequence, the empty string `""`.
451
+
The JSON Serialization is in the form of a JSON object, with property names representing the various components.
452
+
453
+
The `issuer` key has a string value holding the BASE64URL-encoded issuer protected header. This key MUST be included.
454
+
455
+
The `presentation` key has a string value holding the BASE64URL-encoded presentation protected header. It MUST be included for presented form, and MUST be omitted for issued form.
446
456
447
-
Proofs are represented as an array of one or more encoded octet strings.
457
+
The `payloads` key has an array value, representing the ordered sequence of payloads. If a payload has been omitted, it is represented by the JSON value `null`. A payload is otherwise reprented by the BASE64URL-encoded form of the payload octets. A zero-length payload does not have special encoding rules as needed by compact encoding, and is represented by the zero-length string output by BASE64URL. This key MUST be included unless the application is using detached payloads.
448
458
449
-
This example flattened JSON serialization shows the presentation form with both the issuer and presentation headers, and with the first and third payloads hidden.
459
+
The `proofs` key has an array value, representing the array of octet strings produced by the chosen algorithm. These octets are BASE64URL encoded into a JSON array.
460
+
461
+
This example JSON serialization shows the presentation form with both the issuer and presentation headers, and with the first and third payloads hidden.
@@ -479,6 +491,14 @@ unless the application knows that the encrypted content is
479
491
a JWP by another means or convention,
480
492
in which case the `cty` value MAY be omitted.
481
493
494
+
# Detached Payloads
495
+
496
+
In some contexts, it is useful to make statements about payloads which are not themselves contained within the JWP, similar to "Detached Content" in JWS [@RFC7515].
497
+
498
+
For this purpose, the compact, JSON and CBOR serializations allow for all payloads to be omitted from a serialized form. While this is a legal serialization, it is not on its own able to be verified.
499
+
500
+
The recipient is expected to perform some sequence of steps defined by the application to recreate the array of payloads, including order and optionality. This effectively recreates the fully specified serialization of the JWP.
0 commit comments