Bootstrap constructor

Bootstrap({
  1. required Encryption encryption,
  2. void onUpdate(
    1. Bootstrap
    )?,
})

Implementation

Bootstrap({required this.encryption, this.onUpdate}) {
  final defaultKeyId = encryption.ssss.defaultKeyId;
  final hasValidDefaultKey =
      defaultKeyId != null && encryption.ssss.isKeyValid(defaultKeyId);
  if (analyzeSecrets().isNotEmpty || hasValidDefaultKey) {
    state = BootstrapState.askWipeSsss;
  } else {
    state = BootstrapState.askNewSsss;
  }
}