パッケージ、リポジトリ、アプリカテゴリを検索

パッケージ詳細v1.0.5

get_secure_storage

get_storage のセキュアなバージョンで、Dartだけで完全に書かれた高速かつ軽量な同期キー値ストレージです

AndroidiOSWebmacOSWindowsLinux
30日間ダウンロード
1520
いいね数
29
Pub ポイント
130

パッケージをインストール

flutter pub add get_secure_storage

パッケージ概要

公開情報に基づく選定ガイドです。参考としてご利用ください。

GetSecureStorage は、Dart アプリケーション向けに設計された、GetStorage を基盤とした安全で同期的なキー値ストレージソリューションです。Android、iOS、Web、macOS、Windows、Linux など複数のプラットフォームで暗号化されたデータ永続性を提供します。標準ストレージとは異なり、値を保存する前に暗号化することで機密情報を保護し、認証情報やトークン、プライベートなユーザー情報を保管するのに最適です。このパッケージは、元のパッケージの軽量かつ高速なパフォーマンスを維持しながら、堅牢なセキュリティ機能を追加しています。

用途

  • ユーザー認証トークンの保存
  • 暗号化されたAPIキーを保存する
  • 機密なユーザー設定の永続化
  • セッションデータの保護
  • ログイン資格情報の保護
  • セキュアなオフラインデータストレージの有効化

主な機能

  • 保存されたデータのエンドツーエンド暗号化
  • 予測可能な実行のための同期 API
  • クロスプラットフォーム互換性
  • 軽量で高速なパフォーマンス
  • シンプルなキー値インターフェース
  • GetStorage をベースに構築

適している対象

  • セキュアなデータの永続化を必要とするアプリ
  • シンプルさとスピードを重視する開発者
  • 機密ユーザー情報を取り扱うプロジェクト
  • オフラインが必要なモバイルおよびデスクトップアプリケーション
  • 最小限の依存関係でFlutterを使用するチーム

注意事項

  • 大規模なデータセットには適していません
  • 暗号化はわずかなパフォーマンスのオーバーヘッドを追加します
  • 鍵の管理には注意が必要です
  • 基本的なキー値操作に限定
  • 組み込みのデータ移行サポートなし
  • 下位の GetStorage 実装に依存する

元の README

関連するソースリポジトリの README 原文のスナップショットです。最新の内容はリポジトリをご覧ください。

get_secure_storage

A cryptography Secure version of GetStorage originally written by Jonny Borges (https://github.com/jonataslaw/get_storage).

GetSecureStorage is a secure, fast, extra light and synchronous key-value in memory, which backs up data to disk at each operation. It is written entirely in Dart and is based on the Cryptography dart package.

The cryptography library used is https://pub.dev/packages/cryptography

The algorithm used is 128bit AES-CTR with MAC sha256

Supports Android, iOS, Web, Mac, Linux, and Windows. Can store String, int, double, Map and List

Add to your pubspec:
dependencies:
  get_secure_storage:
Install it

You can install packages from the command line:

with Flutter:

$  flutter packages get
Import it

Now in your Dart code, you can use:

import 'package:get_secure_storage/get_secure_storage.dart';
Initialize storage driver with await:
main() async {
  await GetSecureStorage.init(password: 'strongpassword');
  runApp(App());
}
use GetSecureStorage through an instance or use directly GetSecureStorage().read('key')
final box = GetSecureStorage(password: 'strongpassword');
To write information you must use write :
box.write('quote', 'GetSecureStorage is the best');
To read values you use read:
print(box.read('quote'));
// out: GetSecureStorage is the best

To remove a key, you can use remove:
box.remove('quote');
To listen changes you can use listen:
Function? disposeListen;
disposeListen = box.listen((){
  print('box changed');
});
If you subscribe to events, be sure to dispose them when using:
disposeListen?.call();
To listen changes on key you can use listenKey:
box.listenKey('key', (value){
  print('new key is $value');
});
To erase your container:
box.erase();
If you want to create different containers, simply give it a name. You can listen to specific containers, and also delete them.
GetSecureStorage g = GetSecureStorage(container:'MyStorage', password: 'strongpassword');
To initialize specific container:
await GetSecureStorage.init(container:'MyStorage', password: 'strongpassword');

SharedPreferences Implementation

class MyPref {
  static final _otherBox = () => GetSecureStorage(container:'MyPref', password: 'strongpassword');

  final username = ''.val('username');
  final age = 0.val('age');
  final price = 1000.val('price', getBox: _otherBox);

  // or
  final username2 = ReadWriteValue('username', '');
  final age2 = ReadWriteValue('age', 0);
  final price2 = ReadWriteValue('price', '', _otherBox);
}

...

void updateAge() {
  final age = 0.val('age');
  // or 
  final age = ReadWriteValue('age', 0, () => box);
  // or 
  final age = Get.find<MyPref>().age;

  age.val = 1; // will save to box
  final realAge = age.val; // will read from box
}

カテゴリー

依存関係

依存関係一覧 3 件

ソースリポジトリ

このパッケージを使用しているプロジェクト

データはまだありません。