RemoteSecondary constructor

RemoteSecondary(
  1. String atSign,
  2. AtClientPreference preference, {
  3. String? privateKey,
  4. AtChops? atChops,
  5. String? enrollmentId,
})

Implementation

RemoteSecondary(String atSign, AtClientPreference preference,
    {String? privateKey, this.atChops, String? enrollmentId}) {
  _atSign = AtUtils.fixAtSign(atSign);
  logger = AtSignLogger('RemoteSecondary ($_atSign)');
  _preference = preference;
  privateKey ??= preference.privateKey;
  SecureSocketConfig secureSocketConfig = SecureSocketConfig()
    ..decryptPackets = preference.decryptPackets
    ..pathToCerts = preference.pathToCerts
    ..tlsKeysSavePath = preference.tlsKeysSavePath;
  atLookUp = AtLookupImpl(atSign, preference.rootDomain, preference.rootPort,
      privateKey: privateKey,
      cramSecret: preference.cramSecret,
      secondaryAddressFinder:
          AtClientManager.getInstance().secondaryAddressFinder,
      secureSocketConfig: secureSocketConfig,
      clientConfig: _getClientConfig());
  atLookUp.enrollmentId = enrollmentId;
  logger.finer(
      'signingAlgoType: ${preference.signingAlgoType} hashingAlgoType: ${preference.hashingAlgoType}');
  atLookUp.signingAlgoType = preference.signingAlgoType;
  atLookUp.hashingAlgoType = preference.hashingAlgoType;
  atLookUp.atChops = atChops;
}