22
33March 03, 2021
44
5- Version 1.0 .0
5+ Version 1.1 .0
66
77This document describes the recommended data structure for storing DSSE
88signatures, which we call the "JSON Envelope". For the protocol/algorithm, see
@@ -16,9 +16,12 @@ to define the schema. JSON is the only recommended encoding.)
1616The standard data structure for storing a signed message is a JSON message of
1717the following form, called the "JSON envelope":
1818
19- ``` json
19+ ``` jsonc
2020{
21- "payload" : " <Base64(SERIALIZED_BODY)>" ,
21+ // Exactly one of the following must be set:
22+ " payload" : " <Base64Encode(SERIALIZED_BODY)>" ,
23+ " payloadUtf8" : " <Utf8Decode(SERIALIZED_BODY)>" ,
24+ // End oneof
2225 " payloadType" : " <PAYLOAD_TYPE>" ,
2326 " signatures" : [{
2427 " keyid" : " <KEYID>" ,
@@ -29,9 +32,22 @@ the following form, called the "JSON envelope":
2932
3033See [ Protocol] ( protocol.md ) for a definition of parameters and functions.
3134
32- Base64() is [ Base64 encoding] ( https://tools.ietf.org/html/rfc4648 ) , transforming
33- a byte sequence to a unicode string. Either standard or URL-safe encoding is
34- allowed.
35+ Exactly one of ` payload ` or ` payloadUtf8 ` MUST be set:
36+
37+ - ` payload ` supports arbitrary SERIALIZED_BODY.
38+ [ Base64Encode()] ( https://tools.ietf.org/html/rfc4648 ) transforms a byte
39+ sequence to a Unicode string. Base64 has a fixed 33% space overhead but
40+ supports payloads that are not necessarily valid UTF-8. Either standard or
41+ URL-safe encoding is allowed.
42+
43+ - ` payloadUtf8 ` only supports valid
44+ [ UTF-8] ( https://tools.ietf.org/html/rfc3629 ) SERIALIZED_BODY. ` Utf8Decode() `
45+ converts that UTF-8 byte sequence to a Unicode string. Regular JSON string
46+ escaping applies, but this is usually more compact and amenable to
47+ compression than Base64.
48+
49+ Note: The choice of ` payload ` vs ` payloadUtf8 ` does not impact the
50+ [ the signing or the signatures] ( protocol.md#signature-definition ) .
3551
3652### Multiple signatures
3753
@@ -54,8 +70,8 @@ envelopes with individual signatures.
5470
5571### Parsing rules
5672
57- * The following fields are REQUIRED and MUST be set, even if empty: ` payload ` ,
58- ` payloadType ` , ` signature ` , ` signature.sig ` .
73+ * The following fields are REQUIRED and MUST be set, even if empty:
74+ exactly one of { ` payload ` or ` payloadUtf8 ` }, ` payloadType ` , ` signature ` , ` signature.sig ` .
5975* The following fields are OPTIONAL and MAY be unset: ` signature.keyid ` .
6076 An unset field MUST be treated the same as set-but-empty.
6177* Producers, or future versions of the spec, MAY add additional fields.
@@ -75,5 +91,8 @@ At this point we do not standardize any other encoding. If a need arises, we may
7591do so in the future.
7692
7793## Change history
94+ * 1.1.0:
95+ * Added support for UTF-8 encoded payload and ` payloadUtf8 ` field.
96+
7897* 1.0.0: Initial version.
7998
0 commit comments