75 lines
1.6 KiB
Protocol Buffer
75 lines
1.6 KiB
Protocol Buffer
//
|
|
// Copyright (c) 2019 Open Whisper Systems. All rights reserved.
|
|
//
|
|
|
|
// iOS - since we use a modern proto-compiler, we must specify
|
|
// the legacy proto format.
|
|
syntax = "proto2";
|
|
|
|
// iOS - package name determines class prefix
|
|
package KeyBackupProtos;
|
|
|
|
message Request {
|
|
optional BackupRequest backup = 1;
|
|
optional RestoreRequest restore = 2;
|
|
optional DeleteRequest delete = 3;
|
|
}
|
|
|
|
message Response {
|
|
optional BackupResponse backup = 1;
|
|
optional RestoreResponse restore = 2;
|
|
optional DeleteResponse delete = 3;
|
|
}
|
|
|
|
message BackupRequest {
|
|
optional bytes service_id = 1;
|
|
optional bytes backup_id = 2;
|
|
optional bytes nonce = 3;
|
|
optional uint64 valid_from = 4;
|
|
optional bytes data = 5;
|
|
optional bytes pin = 6;
|
|
optional uint32 tries = 7;
|
|
}
|
|
|
|
message BackupResponse {
|
|
enum Status {
|
|
OK = 1;
|
|
NONCE_MISMATCH = 2;
|
|
NOT_YET_VALID = 3;
|
|
}
|
|
|
|
optional Status status = 1;
|
|
optional bytes nonce = 2;
|
|
}
|
|
|
|
message RestoreRequest {
|
|
optional bytes service_id = 1;
|
|
optional bytes backup_id = 2;
|
|
optional bytes nonce = 3;
|
|
optional uint64 valid_from = 4;
|
|
optional bytes pin = 5;
|
|
}
|
|
|
|
message RestoreResponse {
|
|
enum Status {
|
|
OK = 1;
|
|
NONCE_MISMATCH = 2;
|
|
NOT_YET_VALID = 3;
|
|
MISSING = 4;
|
|
PIN_MISMATCH = 5;
|
|
}
|
|
|
|
optional Status status = 1;
|
|
optional bytes nonce = 2;
|
|
optional bytes data = 3;
|
|
optional uint32 tries = 4;
|
|
}
|
|
|
|
message DeleteRequest {
|
|
optional bytes service_id = 1;
|
|
optional bytes backup_id = 2;
|
|
}
|
|
|
|
message DeleteResponse {
|
|
}
|