syntax = "proto3";

package meerkat;

option java_package = "meerkat.protobuf";

import "meerkat/crypto.proto";
import "meerkat/voting.proto";




// Data sent (out-of-band) by the server that the client will require to set up a connection
message ConnectionServerData {
    // Web-API URL for the server
    string server_url = 1;

    // random nonce used for verification of the client.
    bytes nonce = 2;
}

// Data sent by the client in order to set up a connection
message ConnectionClientData {
    // Key used to identify the client
    SignatureVerificationKey scannerPK = 1;

    // Nonce sent by connection-server
    bytes nonce = 2;
}


message ScannedBallot {
    bytes channel = 1;

    SignedEncryptedBallot signed_encrypted_ballot = 2;

}

// Container for error messages
message ScanError {
    string msg = 1;
}

// Container for scanned data
message ScannedData {
    oneof data {
        ScannedBallot ballot = 2;
        ScanError error = 3;
    }
    uint64 serial = 4; // Serial number of the message
    bytes scannerId = 5; // hash of the scannerPK
    Signature scannerSig = 6; // signature on the serialzed form of data.
}

