write method

Future<void> write(
  1. String key,
  2. String value
)

加密并写入数据到安全存储中

如果启用单向加密,将以不可逆方式存储(即不能解密读取)

Implementation

Future<void> write(String key, String value) async {
  final cipheredValue = cipher(
    value,
    passphrase!.length,
    decrypt: isOneWayEncryption!,
  );

  await storage.write(
    key: key,
    value: cipheredValue,
  );

  debugPrint('SecuredStorage [WRITE] $key: $value -> $cipheredValue');
}