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
challengefor 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 withreasonfor 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; throwsexistsif it is already there.backendoverrides the platform module, for tests. -
exists(
String label, {HardwareBackend? backend}) → Future< bool> -
Whether a key named
labelexists. -
open(
String label, {HardwareBackend? backend}) → Future< HardwareKey> -
The existing key for
label; throwsnot_foundwhen absent.