Get desktop application:
View/edit binary Protocol Buffers messages
We are using a NaCl Box (Curve25519+XSalsa20+Poly1305) to encrypt and authorize messages. Note that we are not *explicitly* signing the payload: NaCl Box provides non-repudiability for the receiving party. The receiving party (and only the receiving party) could forge the sender's signature on this message, but we there's no need or possibility for third-party verification in this scheme. See "Security Model" at https://nacl.cr.yp.to/box.html
server_public_key is provided by the Diagnosis Server to the App, and is used to encrypt the payload. This key should be stored locally for 14 days, and used to submit the follow-up Diagnosis Key.
32 bytes
app_public_key is the public side of a keypair generated once by the application and linked to the server_public_key. These are linked in the Diagnosis Server, so that only one app_public_key is authorized to upload for a given server_public_key. If a new server_public_key is issued to an App (e.g. months later), a new app_public_key should be generated.
32 bytes
nonce must be 24 random bytes, and absolutely must NOT be re-used between subsequent submissions of Diagnosis Keys. This nonce is passed to the encryption library to generate the ciphertext.
24 bytes
payload is the result of encoding/marshalling, and then encrypting, an `Upload` message. It is done this way rather than as an embedded message field, because we need to encrypt a byte stream, not an object.
variable length
EncryptedUploadResponse is received from the server in response to a EncryptedUploadRequest. If the request was successful, error will be NONE.
Used in:
The timestamp in the Upload message must be no more than one hour old, otherwise this error is generated.
Clients will receive a One Time Code via some external channel (i.e. SMS or verbal). Then, upon issuing THIS request, they will generate a new keypair. If the response comes back successful, the app_public_key (and the corresponding private key) and the returned server_public_key will be kept in local storage for the duration of this reporting window (the next 14 days). app_public_keys must not be re-used for new KeyClaimRequests, or the requests will fail.
one_time_code is the code received from the testing portal.
8 numerical digits
app_public_key is generated locally and saved upon successful request completion.
32 bytes
KeyClaimResponse is received from the server in response to a KeyClaimRequest. If the request was successful, error will be NONE and server_public_key will be set.
32 bytes
Used in:
Indicates the key is invalid, or already registered.
Used in:
,Key version in case the EN server signing key is rotated.
Additional information to uniquely identify the public key associated with the EN server's signing key (for example, the EN server might serve the app from different countries with different keys). Three-digit mobile country code (MCC) for validating the key file. If a region has more than one MCC, the server can choose which MCC to use. This value does not have to match the client's MCC, but must correspond to one of the supported MCCs for its region.
All keys must be signed using the SHA-256 with ECDSA algorithm. This field must contain the string "1.2.840.10045.4.3.2".
Used in:
Information to uniquely identify the public key associated with the EN server's signing key.
Reserved for future use. Both batch_num and batch_size must be set to a value of 1.
Signature in X9.62 format (ASN.1 SEQUENCE of two INTEGER fields).
Information about associated signatures.
Used in:
,Temporary exposure key.
Varying risk associated with a key depending on the diagnosis method.
Number representing the beginning interval for temporary exposure key validity (ENIntervalNumber).
Number of intervals in a period.
Time window of keys in the file, based on arrival at the server, in UTC seconds.
Region from which these keys came (for example, MCC, however, some schemes use e.g. ISO-3166-2. There's no apparent hard requirement by the protocol for the contents here).
Reserved for future use. Both batch_num and batch_size must be set to a value of 1.
Information about associated signatures.
The temporary exposure keys themselves.
Upload is the decrypted type of the `payload` field in EncryptedUploadRequest.
timestamp is just the current device time at message generation.
keys returns from the ExposureNotification API.