useExistingSsss method

void useExistingSsss(
  1. bool use, {
  2. String? keyIdentifier,
})

Implementation

void useExistingSsss(bool use, {String? keyIdentifier}) {
  if (state != BootstrapState.askUseExistingSsss) {
    throw BootstrapBadStateException('Wrong State');
  }
  if (use) {
    try {
      newSsssKey = encryption.ssss.open(keyIdentifier);
      state = BootstrapState.openExistingSsss;
    } catch (e, s) {
      Logs().e('[Bootstrapping] Error open SSSS', e, s);
      state = BootstrapState.error;
      return;
    }
  } else if (badSecrets().isNotEmpty) {
    state = BootstrapState.askBadSsss;
  } else {
    migrateOldSsss();
  }
}