client.proto 1.84 KB
Newer Older
Loïck Bonniot's avatar
Loïck Bonniot committed
1
/// Protobuf definitions for dfssc
Caro Axel's avatar
Caro Axel committed
2 3 4 5 6
syntax = "proto3";

package api;
import "dfss/dfssp/api/platform.proto";

Loïck Bonniot's avatar
Loïck Bonniot committed
7
/// Procedures offered by dfssc
Caro Axel's avatar
Caro Axel committed
8
service Client {
Loïck Bonniot's avatar
Loïck Bonniot committed
9
	/// Handle reception of promises.
Caro Axel's avatar
Caro Axel committed
10
	rpc TreatPromise(Promise) returns (ErrorCode) {}
Loïck Bonniot's avatar
Loïck Bonniot committed
11
	/// Handle receptions of signatures.
Caro Axel's avatar
Caro Axel committed
12
	rpc TreatSignature(Signature) returns (ErrorCode) {}
Loïck Bonniot's avatar
Loïck Bonniot committed
13
	/// Permits initial handshake for P2P between clients.
Caro Axel's avatar
Caro Axel committed
14 15 16
	rpc Discover(Hello) returns (Hello) {}
}

Loïck Bonniot's avatar
Loïck Bonniot committed
17 18
/// Context stores the current context of a specific promise or signature.
// It is a kind of "symbolic" promise, with no real cryptographic proofs inside.
19
message Context {
Loïck Bonniot's avatar
Loïck Bonniot committed
20 21 22 23 24 25 26 27 28 29
	/// SHA-512 certificate hash
	bytes recipientKeyHash = 1;
	/// SHA-512 certificate hash
	bytes senderKeyHash = 2;
	/// The signing sequence used
	repeated uint32 sequence = 3;
	/// The list of signers hashes, as provided by the dfss file.
	// The order is very important.
	repeated bytes signers = 4;
	/// The contract document hash, as provided by the dfss file
Caro Axel's avatar
Caro Axel committed
30
	bytes contractDocumentHash = 5;
Loïck Bonniot's avatar
Loïck Bonniot committed
31
	/// The unique signature attemp ID, as provided by the platform during the ready signal
Caro Axel's avatar
Caro Axel committed
32
	string signatureUUID = 6;
33 34 35 36 37
	/// The TTP address provided by the platform, to use in case of issue during signature.
	/// Empty if no TTP used.
	string ttpAddrPort = 7;
	/// The TTP certificate SHA-512 hash
	bytes ttpHash = 8;
38
	/// The signed metadata seal, as provided by the platform during the ready signal
39
	bytes seal = 10;
40 41
}

Caro Axel's avatar
Caro Axel committed
42
message Promise {
Loïck Bonniot's avatar
Loïck Bonniot committed
43
	/// Metadata
44
	Context context = 1;
Loïck Bonniot's avatar
Loïck Bonniot committed
45 46 47
	/// The index of the sequence for this promise
	uint32 index = 2;
	/// The crypographic payload, currently NOT IMPLEMENTED
48
	bytes payload = 3;
Caro Axel's avatar
Caro Axel committed
49 50 51
}

message Signature {
Loïck Bonniot's avatar
Loïck Bonniot committed
52
	/// Metadata
53
	Context context = 1;
Loïck Bonniot's avatar
Loïck Bonniot committed
54
	/// The crypographic payload, currently NOT IMPLEMENTED
55
	bytes payload = 2;
Caro Axel's avatar
Caro Axel committed
56 57
}

Loïck Bonniot's avatar
Loïck Bonniot committed
58
/// Hello message is used when discovering peers.
Caro Axel's avatar
Caro Axel committed
59
message Hello {
Loïck Bonniot's avatar
Loïck Bonniot committed
60
	/// Used version of DFSS client
Caro Axel's avatar
Caro Axel committed
61
	string version = 1;
62
}