store_critical_data 0.1.5 copy "store_critical_data: ^0.1.5" to clipboard
store_critical_data: ^0.1.5 copied to clipboard

Secure Storage provides API to store data in secure storage. Keychain is used in iOS, KeyStore based solution is used in Android.

store_critical_data #

A Flutter plugin to store critical data in secure storage:

  • 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 wouldn't work for earlier versions.

Getting Started #

import 'package:store_critical_data/store_critical_data.dart';

// Create storage
final _storage = new StoreCriticalData();

// write String value
_storage.writeString(key: “key”, value: “value”);

// Read String value
String value = _storage.readString(key: "key");

// write Double value
_storage.writeDouble(key: “key”, value: “value”);

// Read Double value
final double value = _storage.readDoubleNew(key: "key");

// Clear value
_storage.clear(key: "key");

// Clear All
 _storage.clearAll();

// Check if Key was store
 _storage.contains(key: "key");


Configure Android version #

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

android {
    ...

    defaultConfig {
        ...
        minSdkVersion 18
        ...
    }

}

Note : By default Android backups data on Google Drive. It can cause exception java.security.InvalidKeyException:Failed to unwrap key.

4
likes
40
points
16
downloads

Publisher

unverified uploader

Weekly Downloads

Secure Storage provides API to store data in secure storage. Keychain is used in iOS, KeyStore based solution is used in Android.

Repository (GitHub)
View/report issues

License

Apache-2.0 (license)

Dependencies

flutter

More

Packages that depend on store_critical_data

Packages that implement store_critical_data