DVMigratingAppKeyStore class

The keyring, reading once from where an earlier version kept the key.

Dartvel used to keep the key on Android and iOS in a file under the home directory. Data sealed under that key has to stay readable, so the key is moved rather than replaced: on the first read that finds the keyring empty and the file present, the key is written to keyring, read back, and the file is removed only once the copy compares equal. A keyring that refuses or drops the write leaves the file where it was and throws, so a failed move loses nothing and is tried again on the next start.

Nothing is ever written to legacy. Writes go to the keyring alone.

Implemented types

Constructors

DVMigratingAppKeyStore({required DVAppKeyStore keyring, required DVAppKeyStore legacy, String? legacyDescription})
const

Properties

hashCode → int
The hash code for this object.
no setterinherited
keyring → DVAppKeyStore
final
legacy → DVAppKeyStore
Where an earlier version kept the key: read, then removed; never written.
final
legacyDescription → String?
Where legacy is, for DVAppKeyStores.describe; null when unknown.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

clear() → Future<void>
Removes the key. The store it protected becomes unreadable, which is survivable: it holds view state.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
read() → Future<Uint8List?>
The stored key, or null when none has been generated.
override
toString() → String
A string representation of this object.
inherited
write(Uint8List key) → Future<void>
Stores key, replacing any previous one.
override

Operators

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