v3.0.1
flutter_keychain
通过 Keychain(iOS)和 Keystore(Android)实现 Flutter 安全存储。支持可选的 iOS 访问组和项目标签。
84喜欢 1.2万近 30 天下载160Pub 分数
AndroidiOS
一个用于在 Android 上通过 KeyStore 和在 iOS 上通过 Keychain 实现安全存储的 Flutter 插件
{"sdk":"flutter"}{"sdk":"flutter"}以下为英文项目原文快照,最新内容请访问 GitHub。
A Flutter plugin for supporting secure storage of strings via Keychain and Keystore
If you have other types you want to store, you need to serialize to and from UTF-8 strings.
Note KeyStore was introduced in Android 4.3 (API level 18). The plugin does not work on earlier versions.
import 'package:flutter_keychain/flutter_keychain.dart';
...
// Get value
var value = await FlutterKeychain.get(key: "key");
// Put value
await FlutterKeychain.put(key: "key", value: "value");
// Remove item
await FlutterKeychain.remove(key: "key");
// Clear the secure store
await FlutterKeychain.clear();
In [project]/android/app/build.gradle set minSdkVersion to >= 18.
android {
...
defaultConfig {
...
minSdkVersion 18
...
}
}
For help on editing plugin code, view the documentation.