Skip to content

Commit 03659e1

Browse files
committed
Create a protobuf schema.
1 parent d7a5afd commit 03659e1

File tree

2 files changed

+29
-0
lines changed

2 files changed

+29
-0
lines changed

envelope.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ signatures, which we call the "JSON Envelope". For the protocol/algorithm, see
1010

1111
## Standard JSON envelope
1212

13+
See [envelope.proto](envelope.proto) for a formal schema. (Protobuf is used only
14+
to define the schema. JSON is the only recommended encoding.)
15+
1316
The standard data structure for storing a signed message is a JSON message of
1417
the following form, called the "JSON envelope":
1518

envelope.proto

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
syntax = "proto3";
2+
3+
package io.intoto;
4+
5+
// An authenticated message of arbitrary type.
6+
message Envelope {
7+
// Message to be signed. (In JSON, this is encoded as base64.)
8+
bytes payload = 1;
9+
10+
// String unambiguously identifying how to interpret payload.
11+
string payloadType = 2;
12+
13+
// Signature over:
14+
// le64(2) || le64(len(utf8(payloadType))) || utf8(payloadType) ||
15+
// le64(len(payload)) || payload
16+
// At least one signature must be present.
17+
repeated Signature signatures = 3;
18+
}
19+
20+
message Signature {
21+
// Signature itself. (In JSON, this is encoded as base64.)
22+
bytes sig = 1;
23+
24+
// *Unauthenticated* hint identifying which public key was used.
25+
string keyid = 2;
26+
}

0 commit comments

Comments
 (0)