code: function generateBeaconStreamAndSecrets(publicKeysToNotify,
                                          ecdhForLocalDevice,
                                          secondsUntilExpiration) {
    var beaconStreamWithPreAmble =
      generatePreambleAndBeacons(publicKeysToNotify, ecdhForLocalDevice,
        secondsUntilExpiration);
  
    if (!beaconStreamWithPreAmble) {
      return null;
    }
  
    var pskMap = generatePskSecrets(publicKeysToNotify, ecdhForLocalDevice,
      beaconStreamWithPreAmble);
  
    return {
      beaconStreamWithPreAmble: beaconStreamWithPreAmble,
      keyAndSecret: pskMap
    };
  }
docs: @typedef {Object} beaconStreamAndSecretDictionary
  @property {Buffer} beaconStreamWithPreAmble
  @property {keyAndSecret} keyAndSecret
   
  This is a unified function that will generate the beacon stream and
  preamble as well as the secret dictionary needed to validate TLS PSK
  connections generated as a consequence of the advertised beacon stream.
  
  @param {Buffer[]} publicKeysToNotify - An array of buffers holding ECDH
  public keys.
  @param {ECDH} ecdhForLocalDevice - A Crypto.ECDH object initialized with the
  local device's public and private keys
  @param {number} secondsUntilExpiration - The number of seconds into the
  future after which the beacons should expire.
  @returns {?beaconStreamAndSecretDictionary}