This documents the functional requirements for building a decentralized exposure notification system. For deployment strategies, see Server Deployment Options.
The Exposure Notification Key Server’s architecture has been split into components. The following diagram shows the relationship between the different components:
The server components are responsible for the following functions:
Accepting the temporary exposure keys of positively diagnosed users from mobile devices, validating those keys via configured public health authority diagnosis verification servers.
Periodically generating incremental files for download by client devices for performing the key matching algorithm that is run on the mobile device. The incremental files must be digitally signed with a private key. The corresponding public key is pushed to mobile device separately.
Required: A database for storage of published diagnosis keys.
Required: A key/secret management system for storage of API keys, other authorization credentials (CDN for example), and private keys for signing device download content.
Recommended: Periodically deleting old temporary exposure keys. After 14 days (or configured time period) the keys can no longer be matched to devices. Please seek legal counsel about data retention policies in your locale.
Recommended: Using a CDN to distribute the temporary exposure keys of affected users to mobile devices.
Before reporting temporary exposure keys to the exposure notifications key server, a diagnosis must first verified by a diagnosis verification server. The diagnosis verification server is intentionally separate from the exposure notifications server. The verification server is run by a local government or public health authority. The exposure notification key server is responsible for validating these certificates.
When a user reports a diagnosis, it is reported using the publish API server. In the reference server implementation, the data is encoded in JSON and sent over HTTPS, however you can use any encoding and protocol. None of the data stored in the database is personally identifiable information (PII).
A given mobile application and server pair could agree upon additional information to be shared. The information described in this section is the minimum required set in order to validate the uploads and to generate the necessary client batches for ingestion into the device for key matching.
We have provides a sample API in exposure_types.go.
Minimum required fields, followed by a JSON example:
temporaryExposureKeys
ExposureKey
JSON objects (below)ExposureKey
object (an individual app/server
could keep longer history)ExposureKey
object properties
key
(REQUIRED)
rollingStartNumber
(REQUIRED)
rollingPeriod
(OPTIONAL - this may not be present for some keys)
transmissionRisk
(REQUIRED)
healthAuthorityID
(REQUIRED)
verificationPayload
(REQUIRED FOR VERIFICATION PROTOCOL)
hmackey
(REQUIRED FOR VERIFICATION PROTOCOL)
symptomOnsetInterval
revisionToken
padding
The following snippet is an example POST request payload in JSON format.
{
"temporaryExposureKeys": [
{"key": "base64 KEY1 (16 bytes)", "rollingStartNumber": 12345, "rollingPeriod": 144, "transmissionRisk": 5},
{"key": "base64 KEY2 (16 bytes)", "rollingStartNumber": 12489, "rollingPeriod": 10, "transmissionRisk": 6},
{"key": "base64 KEYN (16 bytes)", "rollingStartNumber": 12499, "rollingPeriod": 100, "transmissionRisk": 7}],
"healthAuthorityID": "gov.state.doh",
"verificationPayload": "signed JWT issued by public health authority",
"hmackey": "base64 encoded HMAC key used in preparing the data for the verification server",
"symptomOnsetInterval": 12345,
"revisionToken": "empty or result of previous publish",
"padding": "random string data..."
}
The publish request should respond with a structure described in exposure_types.go.
The revision token is a critical piece of ensuring that revised keys that ensures that a different device cannot revise a previously uploaded key. We have a reference implementation in the revision package.
{
"revisionToken": "oaque token that needs to be sent on future publish.",
"insertedExposures": 14,
"error": "omitted, or error message",
"code": "omitted or standard error code",
"padding": "padding to normalize response size"
}
healthAuthorityID
that specifies the
verification certificate signing keys allowed and the region information
for those keys.verificationPayload
field.You should schedule a script that generates files for download over the HTTPS protocol to client devices. The generation of these files are a regular and frequent operation (batches should be generated at least once a day), we recommend that you generate the files in a single operation rather than on-demand, and distribute the files using a CDN.
For information on the format of the batch file, see Exposure Key Export File Format and Verification and Working with Export Files.
The batch file generation should be per-region, incremental feeds of new data. While additional data can be included in the downloads, there is a minimum set that is required by the exposure notification API, which is relayed from affected users in an unmodified form.
The device operating system and libraries will use the known public key to verify an attached data signature before loading the data. To make the data verifiable:
The data must be signed with the private key of the server.
The public key for the server will be distributed by Apple and Google to devices along with a list containing the countries for which the server can provide data to.
Export files must be signed using the ECDSA on the P-256 Curve with a SHA-256 digest.
Important: The matching algorithm only runs on data that has been verified with the public key distributed by the device configuration mechanism.
The app on the device must know which files to download. We recommend that a consistent index file is used so that a client would download that index file to discover any new, unprocessed batches.
If you are using a CDN to distribute these files, ensure that the cache control expiration is set so that the file is refreshed frequently for distribution.
The use of a secure secret manager (for example, Hashicorp Vault, Key Vault, Cloud Secret) or a hardened on-premises equivalent is required to store the following data:
Since devices will only be retaining the temporary exposure keys for a limited time (a configurable number of days), we recommend:
Dropping keys from the database on a similar schedule as they would be dropped from devices.
Removing obsolete files from the CDN.
If used, the index file on the CDN should be updated to no longer point to deleted files.
You should design your database to accommodate bulk deletion due to abuse, broken apps, human error, or incorrect lab results.
Edit this page