HardwareKey class final

A key held by the platform key module under a label. It wraps and unwraps keyring factors; the key itself never leaves the module, and a key created with create and biometric: true unwraps only after the user passes the system biometric prompt.

Properties

backing → HardwareBacking
Where the key lives.
final
hashCode → int
The hash code for this object.
no setterinherited
keyId → Uint8List
The label as the keyring slot's key id.
no setter
label → String
The module name.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

attest(Uint8List challenge) → Future<HardwareAttestation>
Attests this key against challenge for a server.
delete() → Future<void>
Removes the key from the module. Slots it wrapped can no longer unlock.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited
unwrap(Uint8List blob, {String reason = 'Unlock your keys'}) → Future<SecretBytes>
Unwraps blob; shows the biometric prompt with reason for gated keys.
wrap(SecretBytes secret) → Future<Uint8List>
Wraps secret; the output is safe to store.

Operators

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

Static Methods

create(String label, {bool biometric = false, HardwareBackend? backend}) → Future<HardwareKey>
Creates the key for label; throws exists if it is already there. backend overrides the platform module, for tests.
exists(String label, {HardwareBackend? backend}) → Future<bool>
Whether a key named label exists.
open(String label, {HardwareBackend? backend}) → Future<HardwareKey>
The existing key for label; throws not_found when absent.