RemoteSecondary constructor

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

Implementation

RemoteSecondary(String atSign, AtClientPreference preference,
    {String? privateKey,
    AtChops? atChops,
    AtLookUp? atLookUp,
    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;
  _atChops = atChops;
  this.atLookUp = atLookUp ??
      AtLookupImpl(atSign, preference.rootDomain, preference.rootPort,
          privateKey: privateKey,
          cramSecret: preference.cramSecret,
          secondaryAddressFinder:
              AtClientManager.getInstance().secondaryAddressFinder,
          secureSocketConfig: secureSocketConfig,
          clientConfig: _getClientConfig());
  this.atLookUp.enrollmentId = enrollmentId;
  logger.finer(
      'signingAlgoType: ${preference.signingAlgoType} hashingAlgoType: ${preference.hashingAlgoType}');
  this.atLookUp.signingAlgoType = preference.signingAlgoType;
  this.atLookUp.hashingAlgoType = preference.hashingAlgoType;
  this.atLookUp.atChops = atChops;
}