KeychainPassphraseStorage

PassphraseStorage on the Keychain whose setPassphraseIfAbsent only ever adds an item: the Keychain rejects a second item for the same key, so a passphrase another process or thread stored in between is never replaced.

Parameters

keychainConfig

the attributes delegate uses for the shared Keychain items.

Constructors

Link copied to clipboard
constructor(delegate: PassphraseStorage, keychainConfig: ApplePersistenceConfig)

Functions

Link copied to clipboard
open override fun clearPassphrase(key: String)
Link copied to clipboard
fun PassphraseStorage.existingCoreCryptoKey(alias: String): ByteArray?

Read the current key only. Missing, malformed or legacy keys never trigger generation or migration.

Link copied to clipboard

Reads the app's current database key and salt only; never generates or migrates a key.

Link copied to clipboard
open override fun getPassphrase(key: String): String?
Link copied to clipboard
open override fun setPassphrase(key: String, passphrase: String)
Link copied to clipboard
open override fun setPassphraseIfAbsent(key: String, passphrase: String): String

Stores passphrase under key unless a passphrase is stored there already, and returns the stored one.