This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Securely stores string data in SharedPreferences using Tink's AEAD (Authenticated Encryption with | |
| * Associated Data) primitive, backed by AES-256-GCM encryption and Android KeyStore for key management. | |
| */ | |
| object SecureStorage { | |
| // Constants for SharedPreferences and Tink keyset configuration | |
| private const val TAG = "SecureStorage" // For logging | |
| private const val KEYSET_NAME = "tink_keyset" // Name of the Tink keyset stored in SharedPreferences | |
| private const val PREFS_NAME = "secure_prefs" // Name of the SharedPreferences file | |
| private const val MASTER_KEY_URI = "android-keystore://tink_master_key" // URI for the master key in KeyStore |