Skip to content

Commit 68ec423

Browse files
committed
Define "keyid" field.
Now all fields are fully defined.
1 parent a4af882 commit 68ec423

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

specification.md

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,15 @@ The signature format is a JSON message of the following form:
3232
"payload": "<Base64(SERIALIZED_BODY)>",
3333
"payloadType": "<PAYLOAD_TYPE>",
3434
"signatures": [{
35-
,
35+
"keyid": "<KEYID>",
3636
"sig": "<Base64(Sign(PAE([UTF8(PAYLOAD_TYPE), SERIALIZED_BODY])))>"
3737
}, ]
3838
}
3939
```
4040

41-
where:
41+
Empty fields may be omitted. Multiple signatures are allowed.
42+
43+
Definitions:
4244

4345
* SERIALIZED_BODY is the byte sequence to be signed.
4446

@@ -54,6 +56,9 @@ where:
5456
- https://theupdateframework.com/Root/v1.0.5
5557
- etc...
5658

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+
5762
* PAE() is the
5863
[PASETO Pre-Authentication Encoding](https://github.com/paragonie/paseto/blob/master/docs/01-Protocol-Versions/Common.md#authentication-padding),
5964
where parameters `type` and `body` are byte sequences:
@@ -81,6 +86,7 @@ To sign:
8186
- Serialize BODY according to PAYLOAD_TYPE. Call the result SERIALIZED_BODY.
8287
- Sign PAE([UTF8(PAYLOAD_TYPE), SERIALIZED_BODY]), base64-encode the result,
8388
and store it in `sig`.
89+
- Optionally, compute a KEYID and store it in `keyid`.
8490
- Base64-encode SERIALIZED_BODY and store it in `payload`.
8591
- Store PAYLOAD_TYPE in `payloadType`.
8692
@@ -278,7 +284,7 @@ used by TUF and in-toto has a BODY that is a regular JSON object and a signature
278284
{
279285
"signed": <BODY>,
280286
"signatures": [{
281-
,
287+
"keyid": "<KEYID>",
282288
"sig": "<Hex(Sign(CanonicalJson(BODY)))>"
283289
}, ]
284290
}
@@ -299,11 +305,13 @@ To convert an existing signature to the new format:
299305
- `new.payload = base64encode(CanonicalJson(orig.signed))`
300306
- `new.payloadType = "<URI>/backwards-compatible-json"`
301307
- `new.signatures[*].sig = base64encode(hexdecode(orig.signatures[*].sig))`
308+
- `new.signatures[*].keyid = orig.signatures[*].keyid`
302309

303310
To convert a backwards compatible signature to the old format:
304311

305312
- `old.signed = jsonparse(base64decode(new.payload))`
306313
- `old.signatures[*].sig = hexencode(base64decode(new.signatures[*].sig))`
314+
- `old.signatures[*].keyid = new.signatures[*].keyid`
307315

308316
## Testing
309317

0 commit comments

Comments
 (0)