OverlayPassphraseSession

@Singleton
class OverlayPassphraseSession @Inject constructor

Caches decrypted passphrases per key id with a TTL and a hard capacity so the overlay can decrypt repeatedly without re-prompting, while limiting exposure.

Entries expire after a fixed TTL and the oldest is evicted past the capacity limit. All stored buffers are zeroed on removal.

Constructors

Link copied to clipboard
@Inject
constructor()

Functions

Link copied to clipboard
fun clear(keyId: Long)

Removes and zeroes the cached passphrase for keyId.

Link copied to clipboard
fun clearAll()

Removes and zeroes all cached passphrases (e.g. on screen off/low memory).

Link copied to clipboard
fun get(keyId: Long): CharArray?

Returns a defensive copy of the cached passphrase for keyId, or null when absent or expired (expired entries are cleared).

Link copied to clipboard
fun put(keyId: Long, passphrase: CharArray)

Stores a copy of passphrase for keyId with a fresh TTL, then trims.