搜尋套件、儲存庫與 APP 分類

套件詳情v3.0.1

flutter_keychain

透過 Keychain(iOS)和 Keystore(Android)實作 Flutter 安全儲存。支援可選的 iOS 存取群組與項目標籤。

AndroidiOS
近 30 天下載
1.6萬
喜歡數
86
Pub 分數
160

安裝套件

flutter pub add flutter_keychain

套件介紹

根據套件公開資料產生的選型評估,僅供參考。

Flutter Keychain 提供使用 iOS Keychain 和 Android Keystore 的安全、平台特定資料儲存。它支援憑證與權杖的加密持久化,並支援可選的 iOS 存取群組與項目標籤。設計用於高安全性,確保資料在作業系統層級受到保護,最小化未經授權存取的風險。非常適合以符合平台安全最佳實務的方式儲存驗證權杖、API 金鑰或其他機密資訊。

適用情境

  • 儲存使用者驗證權杖
  • 安全儲存API金鑰
  • 保持登錄憑據
  • 管理加密密鑰
  • 處理敏感用戶數據
  • 在 iOS 上啟用跨應用資料共享

主要特色

  • 透過作業系統金鑰鏈進行加密儲存
  • 支援 iOS 存取群組
  • iOS 上的項目標記
  • 跨平台相容性
  • 安全的數據隔離
  • 自動加密

適合對象

  • 需要安全憑證存儲的應用程式
  • 認證密集型應用
  • 注重合規的項目
  • 處理敏感數據的移動應用
  • 同時針對 iOS 和 Android 的開發者
  • 需要作業系統層級安全性的應用程式

使用建議

  • 需要正確的權限處理
  • 限於小數據量
  • 跨平台無直接資料獲取
  • 依賴於作業系統安全功能
  • 不適用於大型資料集
  • 可能需要為iOS存取群組進行額外設定

原始 README

以下為關聯原始碼儲存庫的 README 原文快照,最新內容請造訪原始碼儲存庫。

flutter_keychain

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.

  • Keychain is used for iOS
  • AES encryption is used for Android. AES secret key is encrypted with RSA and RSA key is stored in KeyStore

Note KeyStore was introduced in Android 4.3 (API level 18). The plugin does not work on earlier versions.

Getting Started


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();

Configure Android version

In [project]/android/app/build.gradle set minSdkVersion to >= 18.

android {
    ...
    defaultConfig {
        ...
        minSdkVersion 18
        ...
    }
}

Contributing

For help on editing plugin code, view the documentation.

所屬分類

原始碼儲存庫

使用此套件的專案