MacComponent class
Builds the MAC over the selected fields and writes it into field 64.
Ported from MACComponent. The field list, the pack/unpack round trip that
normalises each value, and the "init logon uses the default MAC key" rule
are all reproduced exactly — a single byte out of place and the host rejects
the message.
Constructors
- MacComponent({required HostConfig config, required IsoSecurityModule securityModule})
Properties
- config → HostConfig
-
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- securityModule → IsoSecurityModule
-
final
Methods
-
buildMacData(
IsoMsg message) → Uint8List - Packs the selected fields, unpacks them again, then concatenates the normalised values. The round trip is what makes the terminal and the host agree on padding.
-
checkMac(
IsoMsg message, int macLength) → Future< bool> - Recomputes the MAC over the response and compares. The MAC field is removed only when it matched, as in the Java, so a failed check leaves the message untouched for logging.
-
generateMac(
IsoMsg message, int macLength) → Future< void> -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
usesDefaultMac(
IsoMsg message) → bool - Init logon (0800/0810 with processing code 920000 or 920001) is MACed with the key derived from the KTM; everything else uses the session MAC key.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Constants
-
selectedFields
→ const List<
int>