SecureKeyCache class final

A synchronous, session-scoped snapshot over a SecureKeyStore.

null stores (web hosts, tests) are supported: available is then false and every read misses, so callers need no null checks beyond available.

Constructors

SecureKeyCache(SecureKeyStore? _store)
Creates a cache over store (may be null → always unavailable).

Properties

available → bool
Whether the platform store answered the availability probe (run by preload or probe).
no setter
hashCode → int
The hash code for this object.
no setterinherited
label → String?
The backing store's label (for messages), or null when there is none.
no setter
names → Iterable<String>
The names currently held in the snapshot.
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

delete(String name) → Future<bool>
Deletes name from the store and the snapshot. Returns false when the store is unavailable or the delete fails; deleting an absent name is a no-op.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
preload(Iterable<String> names) → Future<void>
Probes the store and, when available, loads names into the snapshot (parallel reads; individual misses/errors simply stay absent — a keychain must never break startup).
probe() → Future<bool>
Probes availability without loading anything. Idempotent.
read(String name) → String?
Synchronous read from the snapshot (null when absent).
save(String name, String value) → Future<bool>
Writes value through to the store and updates the snapshot. Returns false when the store is unavailable OR the write fails (locked or MDM-managed keychain, missing Secret Service provider) — a failing backend must degrade to session-only, never crash the CLI.
toString() → String
A string representation of this object.
inherited

Operators

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