Skip to content

A flutter plugin for secure storage on Android via KeyStore and iOS via Keychain

License

Notifications You must be signed in to change notification settings

idy/flutter_keychain

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

44 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

A flutter plugin for secure storage on Android via KeyStore and iOS via Keychain

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Kotlin 52.3%
  • Objective-C 17.2%
  • Dart 14.0%
  • Ruby 11.8%
  • Shell 3.1%
  • Swift 1.6%