AndroidOptions constructor
const
AndroidOptions({
- bool resetOnError = true,
- bool migrateOnAlgorithmChange = true,
- bool migrateWithBackup = false,
- bool enforceBiometrics = false,
- KeyCipherAlgorithm keyCipherAlgorithm = KeyCipherAlgorithm.RSA_ECB_OAEPwithSHA_256andMGF1Padding,
- StorageCipherAlgorithm storageCipherAlgorithm = StorageCipherAlgorithm.AES_GCM_NoPadding,
- AndroidBiometricType biometricType = AndroidBiometricType.biometricOrDeviceCredential,
- bool requireBiometricConfirmation = true,
- String? preferencesKeyPrefix,
- String? storageNamespace,
- String? biometricPromptTitle,
- String? biometricPromptSubtitle,
- String? biometricPromptNegativeButton,
Standard secure storage using AES-GCM with RSA OAEP key wrapping.
This is the default constructor with strong security:
- RSA/ECB/OAEPWithSHA-256AndMGF1Padding for key protection
- AES/GCM/NoPadding for data encryption
- No biometric authentication required
- API 23+ (Android 6.0+)
For biometric authentication, use AndroidOptions.biometric().
Advanced users can customize cipher algorithms for specific use cases:
- AES_GCM_NoPadding storage + RSA key ciphers (standard RSA wrapping)
- AES_GCM_NoPadding storage + AES_GCM_NoPadding key (KeyStore-based, supports biometrics)
Implementation
const AndroidOptions({
bool resetOnError = true,
bool migrateOnAlgorithmChange = true,
bool migrateWithBackup = false,
bool enforceBiometrics = false,
KeyCipherAlgorithm keyCipherAlgorithm =
KeyCipherAlgorithm.RSA_ECB_OAEPwithSHA_256andMGF1Padding,
StorageCipherAlgorithm storageCipherAlgorithm =
StorageCipherAlgorithm.AES_GCM_NoPadding,
AndroidBiometricType biometricType =
AndroidBiometricType.biometricOrDeviceCredential,
bool requireBiometricConfirmation = true,
this.preferencesKeyPrefix,
this.storageNamespace,
this.biometricPromptTitle,
this.biometricPromptSubtitle,
this.biometricPromptNegativeButton,
}) : _resetOnError = resetOnError,
_migrateOnAlgorithmChange = migrateOnAlgorithmChange,
_migrateWithBackup = migrateWithBackup,
_enforceBiometrics = enforceBiometrics,
_keyCipherAlgorithm = keyCipherAlgorithm,
_storageCipherAlgorithm = storageCipherAlgorithm,
_biometricType = biometricType,
_requireBiometricConfirmation = requireBiometricConfirmation;