@@ -32,13 +32,15 @@ The signature format is a JSON message of the following form:
32
32
"payload" : " <Base64(SERIALIZED_BODY)>" ,
33
33
"payloadType" : " <PAYLOAD_TYPE>" ,
34
34
"signatures" : [{
35
- … ,
35
+ "keyid" : " <KEYID> " ,
36
36
"sig" : " <Base64(Sign(PAE([UTF8(PAYLOAD_TYPE), SERIALIZED_BODY])))>"
37
37
}, … ]
38
38
}
39
39
```
40
40
41
- where:
41
+ Empty fields may be omitted. Multiple signatures are allowed.
42
+
43
+ Definitions:
42
44
43
45
* SERIALIZED_BODY is the byte sequence to be signed.
44
46
54
56
- https://theupdateframework.com/Root/v1.0.5
55
57
- etc...
56
58
59
+ * KEYID is an optional, unauthenticated hint indicating what key was used to
60
+ sign the message. It ** must not** be used for security decisions.
61
+
57
62
* PAE() is the
58
63
[ PASETO Pre-Authentication Encoding] ( https://github.com/paragonie/paseto/blob/master/docs/01-Protocol-Versions/Common.md#authentication-padding ) ,
59
64
where parameters ` type ` and ` body ` are byte sequences:
@@ -81,6 +86,7 @@ To sign:
81
86
- Serialize BODY according to PAYLOAD_TYPE. Call the result SERIALIZED_BODY.
82
87
- Sign PAE([UTF8(PAYLOAD_TYPE), SERIALIZED_BODY]), base64-encode the result,
83
88
and store it in `sig`.
89
+ - Optionally, compute a KEYID and store it in `keyid`.
84
90
- Base64-encode SERIALIZED_BODY and store it in `payload`.
85
91
- Store PAYLOAD_TYPE in `payloadType`.
86
92
@@ -278,7 +284,7 @@ used by TUF and in-toto has a BODY that is a regular JSON object and a signature
278
284
{
279
285
"signed" : <BODY>,
280
286
"signatures" : [{
281
- … ,
287
+ "keyid" : " <KEYID> " ,
282
288
"sig" : " <Hex(Sign(CanonicalJson(BODY)))>"
283
289
}, … ]
284
290
}
@@ -299,11 +305,13 @@ To convert an existing signature to the new format:
299
305
- ` new.payload = base64encode(CanonicalJson(orig.signed)) `
300
306
- ` new.payloadType = "<URI>/backwards-compatible-json" `
301
307
- ` new.signatures[*].sig = base64encode(hexdecode(orig.signatures[*].sig)) `
308
+ - ` new.signatures[*].keyid = orig.signatures[*].keyid `
302
309
303
310
To convert a backwards compatible signature to the old format:
304
311
305
312
- ` old.signed = jsonparse(base64decode(new.payload)) `
306
313
- ` old.signatures[*].sig = hexencode(base64decode(new.signatures[*].sig)) `
314
+ - ` old.signatures[*].keyid = new.signatures[*].keyid `
307
315
308
316
## Testing
309
317
0 commit comments