SecureCookie class
A secure cookie implementation supporting both HMAC signing and AES encryption. Provides three security modes:
- HMAC only: Signs data to prevent tampering
- AES only: Encrypts data for confidentiality
- Both: Combines encryption and signing for maximum security
Constructors
- SecureCookie({dynamic key, SecurityMode? mode, bool useEncryption = false, bool useSigning = false})
-
Factory constructor to create a new SecureCookie with the provided key and security mode.
factory
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
constantTimeEquals(
String a, String b) → bool -
decode(
String name, String cookieValue) → Map< String, dynamic> - Decode a secured string back into session values.
-
encode(
String name, Map< String, dynamic> values) → String - Encode session values into a secured string based on the security mode.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
generateKey(
) → String