SecureFlightSerializer class

Serialises / deserialises FlightSession objects to / from encrypted .eflightlog files.

Encryption uses CryptoEngine (ChaCha20-inspired stream cipher + HMAC-SHA256), applied on top of GZIP-compressed JSON.

Example usage:

final key    = CryptoEngine.generateRandomKey();
final crypto = CryptoEngine.withKey(key);
final ser    = SecureFlightSerializer(crypto: crypto);

// Write
final file = await ser.writeEncryptedToFile(session, '/tmp/my.eflightlog');

// Read back
final loaded = await ser.readEncryptedFromFile('/tmp/my.eflightlog');

Constructors

SecureFlightSerializer({required CryptoEngine crypto})
const

Properties

crypto → CryptoEngine
final
hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

fromEncryptedBytes(Uint8List bytes) → FlightSession
Decrypts and deserialises a FlightSession from bytes produced by toEncryptedBytes.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
readEncryptedFromFile(String filePath) → Future<FlightSession>
Reads the file at filePath, decrypts, and deserialises the FlightSession.
toEncryptedBytes(FlightSession session) → Uint8List
Serialises session to an encrypted .eflightlog byte array.
toString() → String
A string representation of this object.
inherited
writeEncryptedToFile(FlightSession session, String filePath) → Future<File>
Serialises session, encrypts it, and writes the result to filePath.

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Static Methods

hasEflightMagic(Uint8List bytes) → bool
Returns true if bytes begin with the 8-byte .eflightlog magic header.
readAutoDetect(String filePath, {CryptoEngine? crypto}) → Future<FlightSession>
Reads filePath and auto-detects whether it is an encrypted .eflightlog or a plain .flightlog.