mirror of
https://github.com/android-password-store/Android-Password-Store
synced 2025-08-29 13:27:46 +00:00
feat(gpg): add methods to clear entries from GPG passphrase cache
This commit is contained in:
parent
65509eaa54
commit
5420faff34
@ -37,6 +37,19 @@ constructor(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
suspend fun clearCachedPassphrase(
|
||||||
|
context: Context,
|
||||||
|
identifier: GpgIdentifier,
|
||||||
|
) {
|
||||||
|
withContext(dispatcherProvider.io()) {
|
||||||
|
getPreferences(context).edit { remove(identifier.toString()) }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
suspend fun clearAllCachedPassphrases(context: Context) {
|
||||||
|
withContext(dispatcherProvider.io()) { getPreferences(context).edit { clear() } }
|
||||||
|
}
|
||||||
|
|
||||||
private suspend fun getPreferences(context: Context) =
|
private suspend fun getPreferences(context: Context) =
|
||||||
withContext(dispatcherProvider.io()) {
|
withContext(dispatcherProvider.io()) {
|
||||||
EncryptedSharedPreferences.create(
|
EncryptedSharedPreferences.create(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user