feat(gpg): add methods to clear entries from GPG passphrase cache
This commit is contained in:
parent
65509eaa54
commit
5420faff34
1 changed files with 13 additions and 0 deletions
|
@ -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) =
|
||||
withContext(dispatcherProvider.io()) {
|
||||
EncryptedSharedPreferences.create(
|
||||
|
|
Loading…
Reference in a new issue