PassphraseBasedKeyManager class abstract
An extension of the standard KeyManager that generates it's master key based of a passphrase.
This class implements loadRemoteMasterKey by deriving the key from a passphrase as well as other parameters. Those parameters must be provided by implementing the loadMasterKeyComponents method.
Note: The used generation algorithm is very computation heavy and thus might freeze the UI for a few seconds. This is by design, to ensure keys cannot easily be brute-forced by just guessing passwords. To prevent the ui from freezing, you should use the ParallelMasterKeyComputation mixin to run the code on a separate isolate.
- Inheritance
-
- Object
- KeyManager
- PassphraseBasedKeyManager
Constructors
- PassphraseBasedKeyManager({required Sodium sodium, Clock? clock})
- Default constructor.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- sodium → Sodium
-
The sodium instance used by the key manager.
finalinherited
Methods
-
dispose(
) → void -
Disposes the key manager.
inherited
-
initialize(
) → Future< void> -
Initializes the key manager.
inherited
-
loadMasterKeyComponents(
int saltLength) → FutureOr< MasterKeyComponents> - Asynchronously loads the master key components to derive the key from.
-
loadRemoteMasterKey(
int keyLength) → Future< SecureKey> -
Asynchronously loads the master key for the key manager.
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
remoteKeyForType(
String type, int keyLength) → KeyInfo -
Generates a
SecureKey
ofkeyLength
bytes for the giventype
.inherited -
remoteKeyForTypeAndId(
String type, int keyId, int keyLength) → SecureKey -
Generates a
SecureKey
ofkeyLength
bytes for the giventype
andkeyId
.inherited -
subkeyIdForType(
String type) → int -
Derives a key id from a given repository
type
.inherited -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited