Secure Storage Infrastructure
Component Detail
Infrastructure
medium complexity
Shared Component
mobile
0
Dependencies
2
Dependents
0
Entities
0
Integrations
Description
Wraps flutter_secure_storage to provide hardware-backed secure storage delegating to iOS Keychain and Android Keystore. Ensures JWT access and refresh tokens, biometric credentials, and per-user encryption keys are never stored in SharedPreferences or plain SQLite.
secure-storage-infrastructure
Responsibilities
- Store and retrieve sensitive values (tokens, keys, credentials) using OS-level hardware-backed storage
- Abstract platform differences between iOS Keychain and Android Keystore
- Enforce that JWT tokens are only ever persisted through this layer
- Support secure deletion of credentials on logout or account removal
Interfaces
write(key: String, value: String): Future<void>
read(key: String): Future<String?>
delete(key: String): Future<void>
deleteAll(): Future<void>
containsKey(key: String): Future<bool>
readAll(): Future<Map<String, String>>
storeJwtTokens(accessToken: String, refreshToken: String): Future<void>
readJwtTokens(): Future<TokenPair?>
clearJwtTokens(): Future<void>
storeEncryptionKey(userId: String, key: String): Future<void>
readEncryptionKey(userId: String): Future<String?>
storePrivateKey(userId: String, privateKey: String): Future<void>
readPrivateKey(userId: String): Future<String?>
Relationships
Dependents (2)
Components that depend on this component