Giter Site home page Giter Site logo

askmetoo / flutter_secure_storage Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mogol/flutter_secure_storage

0.0 0.0 0.0 11.5 MB

A Flutter plugin to store data in secure storage

Home Page: https://pub.dartlang.org/packages/flutter_secure_storage

License: BSD 3-Clause "New" or "Revised" License

Java 47.97% Ruby 3.80% Objective-C 19.08% Dart 29.15%

flutter_secure_storage's Introduction

flutter_secure_storage

A Flutter plugin to store 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:flutter_secure_storage/flutter_secure_storage.dart';

// Create storage
final storage = new FlutterSecureStorage();

// Read value 
String value = await storage.read(key: key);

// Read all values
Map<String, String> allValues = await storage.readAll();

// Delete value 
await storage.delete(key: key);

// Delete all 
await storage.deleteAll();

// Write value 
await storage.write(key: key, value: value);

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. You need to

Integration Tests

Run the following command from example directory

flutter drive --target=test_driver/app.dart

flutter_secure_storage's People

Contributors

mogol avatar zhenqiu1101 avatar lidongze91 avatar hnvn avatar jthlim avatar mehmetf avatar wytesk133 avatar bergkamphun avatar bbedward avatar bcko avatar charleshan avatar gerritkopp avatar hmawla avatar maleandr avatar nate-eisner avatar negator avatar hacker1024 avatar morrica avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.