A library to load Temporary Exposure Keys (TEK). For more information on the format see https://developers.google.com/android/exposure-notifications/exposure-key-file-format.
Run yarn add exposure-keys
or npm install exposure-keys
.
import * as fs from 'node:fs';
import {loadZip, loadKeys, loadSignature} from 'exposure-keys';
(async () => {
const zippedData = await fs.promises.readFile('2019-06-24.bin');
const unzippedData = await loadZip(zippedData);
const keys = loadKeys(unzippedData.keys);
const signature = loadSignature(unzippedData.signature);
// ...
})().catch(error => console.error(error));