SaltedVerificationKey class
Salted verification key generated during user registration.
This data structure contains the verification key and salt that must be stored on the server for future authentication. The verification key is derived from the user's password using a KDF, but cannot be reversed to recover the password.
Usage:
- User generates this during registration via User.createSaltedVerificationKey.
- User sends key and salt to server (e.g., via JSON serialization).
- Server stores both values in its user database.
- During future logins, server uses these values to create authentication challenges.
Security:
- The verification key is password-equivalent data - protect it like a password hash.
- Never send the verification key back to the user after registration.
- Use erase to securely zero out the data when no longer needed.
Constructors
- SaltedVerificationKey({required Uint8List key, required Uint8List salt})
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- key → Uint8List
-
Verification key derived from password and salt (password verifier 'v').
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- salt → Uint8List
-
Cryptographic salt used during key derivation.
final
Methods
-
erase(
) → void - Securely overwrites all sensitive data with zeros.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → Map< String, dynamic> - Converts this object to a JSON-serializable map.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
fromJson(
Map< String, dynamic> json) → SaltedVerificationKey - Creates a SaltedVerificationKey from a JSON map.