turbo-secure-storage
v0.2.0
Published
React 0.68+ Turbo Module for securely storing data using Keychain on iOS and KeyStore on Android
Downloads
10
Readme
A turbo-module to securely store data, uses Keychain on iOS and KeyStore/EncryptedSharedPreferences on Android. It also supports Biometric authentication
Gotcha's
- This being a TurboModule is only compatible with RN 0.68+
- Android's min SDK API is 23, to take advantange of the official keystore implementation
Examples
import TurboSecureStorage, { ACCESSIBILITY } from 'turbo-secure-storage';
const { error } = TurboSecureStorage.setItem('foo', 'bar', {
accessibility: ACCESSIBILITY.WHEN_PASSCODE_SET_THIS_DEVICE_ONLY, // the most secure option
withBiometrics: true,
});
const { error, value } = TurboSecureStorage.getItem('foo', {
withBiometrics: true,
});
const { error } = TurboSecureStorage.deleteItem('foo', {
withBiometrics: true,
});
Unfortunately due how codegen works, you need always need to pass the options object, even if it is empty
iOS Accessibility
On iOS you can specify an accesibility value which allows to customize when the data is readable.
TODO
- [x] Implement official Android keystore implementation
- [x] Add passcode / password fallback for Android if possible
- [ ] Add
getAllKeys
,getAllItems
anddeleteAllItems
methods if possible - [ ] Support Secure Enclave on Apple devices
- [ ] Revisit Android code to make sure it handles all edge cases (RTL text)
- [ ] Create testing device list
- [ ] Security audit by expert
About me
I'm available for React Native consulting and also create other products, get in touch. You can also see how this library was built from scratch on my YouTube channel.
License
MIT License