isPasswordProtectedAtKeysFile function

bool isPasswordProtectedAtKeysFile(
  1. File file
)

Implementation

bool isPasswordProtectedAtKeysFile(File file) {
  try {
    final content = file.readAsStringSync();
    final json = jsonDecode(content);
    return json is Map<String, dynamic> && json.containsKey('iv');
  } catch (_) {
    return false;
  }
}