decryptFile method

  1. @override
Future<bool> decryptFile({
  1. required String inputPath,
  2. required String outputPath,
  3. required String key,
  4. String? iv,
})
override

Decrypts the file at inputPath and writes the result to outputPath.

Implementation

@override
Future<bool> decryptFile({
  required String inputPath,
  required String outputPath,
  required String key,
  String? iv,
}) async {
  try {
    final inputBytes = await _readFile(inputPath);
    final decryptedBytes = await decryptBytes(cipherBytes: inputBytes, key: key, iv: iv);
    _virtualFileSystem[outputPath] = decryptedBytes;
    return true;
  } catch (e, st) {
    dev.log('decryptFile failed: $e', name: 'AesEncryptFileWeb', error: e, stackTrace: st);
    return false;
  }
}