Skip to content

Commit 2f22dc4

Browse files
authored
Merge pull request #24 from MarkLodato/protobuf
Create a protobuf schema.
2 parents d7a5afd + cd70f40 commit 2f22dc4

File tree

2 files changed

+37
-0
lines changed

2 files changed

+37
-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: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
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+
// REQUIRED.
9+
bytes payload = 1;
10+
11+
// String unambiguously identifying how to interpret payload.
12+
// REQUIRED.
13+
string payloadType = 2;
14+
15+
// Signature over:
16+
// le64(2) || le64(len(utf8(payloadType))) || utf8(payloadType) ||
17+
// le64(len(payload)) || payload
18+
// where:
19+
// le64(n) := 64-bit little-endian encoding of integer `n`, 0 <= n < 2^63
20+
// len(s) := number of octets in byte sequence `s`
21+
// utf8(s) := UTF-8 encoding of unicode string `s`
22+
// REQUIRED (length >= 1).
23+
repeated Signature signatures = 3;
24+
}
25+
26+
message Signature {
27+
// Signature itself. (In JSON, this is encoded as base64.)
28+
// REQUIRED.
29+
bytes sig = 1;
30+
31+
// *Unauthenticated* hint identifying which public key was used.
32+
// OPTIONAL.
33+
string keyid = 2;
34+
}

0 commit comments

Comments
 (0)