EncryptedScanData.fromJson constructor
Deserializes from JSON-compatible map.
Implementation
factory EncryptedScanData.fromJson(Map<String, dynamic> json) {
return EncryptedScanData(
ciphertext: base64Decode(json['ciphertext'] as String),
iv: base64Decode(json['iv'] as String),
salt: base64Decode(json['salt'] as String),
encryptedAt: DateTime.parse(json['encryptedAt'] as String),
expiresAt: json['expiresAt'] != null
? DateTime.parse(json['expiresAt'] as String)
: null,
modeHint: json['modeHint'] as String?,
);
}