PlatformKeyStore

class PlatformKeyStore(keyProvider: PlatformKeyProvider, queries: WalletPersistenceQueries) : WalletKeyStore

Wallet key store that persists key metadata in SQLDelight.

Platform-backed keys keep their material in the platform key store. Software keys store serialized key material in the SQLDelight table so they can be reloaded on platforms that require a fallback.

Parameters

keyProvider

Platform key provider used to load, export, and delete keys.

queries

SQLDelight queries for wallet persistence tables.

Constructors

Link copied to clipboard
constructor(keyProvider: PlatformKeyProvider, queries: WalletPersistenceQueries)

Functions

Link copied to clipboard
open suspend override fun addKey(key: Key): String

Persists a key reference for key.

Link copied to clipboard
open suspend fun getDefaultKey(): Key?
Link copied to clipboard
open suspend override fun getKey(keyId: String): Key?

Loads a wallet key by its wallet-local key identifier.

Link copied to clipboard
open suspend override fun listKeys(): Flow<WalletKeyInfo>

Streams all persisted key references.

Link copied to clipboard
open suspend fun listKeysAsList(): List<WalletKeyInfo>
Link copied to clipboard
open suspend override fun removeKey(keyId: String): Boolean

Removes the platform-backed key when present and deletes its SQLDelight key reference.