TomSettingsKeyBootstrap class

Ensures this device has a key for its encrypted settings container.

A chicken-and-egg problem with exactly one escape. The settings container holds the tokens and document keys, so it must be encrypted — but its own key cannot live inside it, and device settings must hold no secret. So one secret is held per device, outside both: in the platform secret store, with only its handle recorded in device settings.

Two consequences make the arrangement safe rather than merely workable:

  • The key is minted, not chosen. There is no passphrase prompt at first launch. A password invented for a file the user did not know existed is a weak one, and the device already has somewhere better to keep a strong one.
  • Losing it loses only the settings. Documents have their own keys, which is why a wiped keychain is survivable at all — and why the honest response to one is a container that refuses to open rather than a fresh empty one written over the user's settings.

Opening the container with the key is the container binding's business; this class knows no container format.

Constructors

TomSettingsKeyBootstrap({required TomDeviceSettings device, required TomSecretStore secrets})

Properties

device → TomDeviceSettings
final
hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
secrets → TomSecretStore
final

Methods

ensure({String? message}) → Future<TomSettingsKey>
The device's settings key, minted and recorded when it has none.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited