SqlDelightKeyStore

class SqlDelightKeyStore(managedKeyProvider: PlatformManagedKeyProvider, queries: WalletPersistenceQueries) : WalletKeyStore

Wallet key store backed by SQLDelight.

Every row persists the versioned StoredKey descriptor required to restore the key. Managed keys retain private material in the native platform store; software keys retain their encoded material in the descriptor. This is a fresh-schema store and deliberately does not read, repair, or write legacy key references.

Constructors

Link copied to clipboard
constructor(managedKeyProvider: PlatformManagedKeyProvider, queries: WalletPersistenceQueries)

Functions

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

Persists a versioned descriptor without exporting it through the legacy key API.

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

Legacy keys must be converted to a storable key before they are persisted.

Link copied to clipboard
suspend fun generateKey(request: WalletKeyCreationRequest): Key

Generates and persists either a software or managed Crypto2 key.

Link copied to clipboard
open suspend override fun getCrypto2Key(keyId: String, usages: Set<KeyUsage>): Key?

Restores a persisted storable key with the requested usages.

Link copied to clipboard
open suspend fun getDefaultCrypto2Key(usages: Set<KeyUsage>): Key?
Link copied to clipboard
open suspend fun getDefaultKey(): Key?
Link copied to clipboard
open suspend override fun getKey(keyId: String): Key?

Legacy key material is not supported by the mobile store.

Link copied to clipboard
open suspend override fun getKeyMaterial(keyId: String, usages: Set<KeyUsage>): WalletKeyStoreEntry?

Restores a persisted key as a wallet key-store entry.

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

Lists the identifiers and specifications of all persisted keys.

Link copied to clipboard
open suspend fun listKeysAsList(): List<WalletKeyInfo>
Link copied to clipboard

Checks whether the wallet can satisfy the request using a managed key or an allowed software key.

Link copied to clipboard
open suspend override fun removeKey(keyId: String): Boolean

Removes a persisted key and any managed native key material it owns.