Secure sensitive data in Local Storage
Secure sensitive data in Local Storage
Allows you to save key/value pairs of sensitive data and protects it via device's internal security.
- Uses Keychain for iOS, and
- Encrypted Preferences for Android
To get started using it, you must use KmpSecureStorage.
Persist data in secure storage
_1KmpSecureStorage.persistData("my_key", dataToStore) // dataToStore can be a String, Int, Boolean, or Float
Fetch data from Storage
Below are the functions available:
_4KmpSecureStorage.getStringFromKey(key: String): String_4KmpSecureStorage.getIntFromKey(key: String): Int_4KmpSecureStorage.getFloatFromKey(key: String): Float_4KmpSecureStorage.getBooleanFromKey(key: String): Boolean
Clear data from Storage
To delete a key/value pair from storage:
_1KmpSecureStorage.deleteDataForKey(key: String)
And to clear all data from the store
_1KmpSecureStorage.clearEntireStore(key: String)
iOS Setup?
Specify the keychain appgroup for your app.
_1KmpSecureStorage.configureSecurityForiOS(serviceName: String, accessGroup: String)