SqlDelightKeyStore

class SqlDelightKeyStore(managedKeyProvider: PlatformManagedKeyProvider, queries: WalletPersistenceQueries, identityWalletId: String = "default") : MobileWalletKeyStore

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, identityWalletId: String = "default")

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

Creates software material only when no native authorization requirement is selected.

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 override fun getDefaultCrypto2Key(usages: Set<KeyUsage>): Key?

An established identity controls default-key selection, including when its key is missing.

Link copied to clipboard
open suspend fun getDefaultKey(): Key?
Link copied to clipboard
open suspend override fun getDefaultKeyMaterial(usages: Set<KeyUsage>): WalletKeyStoreEntry?

Keeps issuance/presentation key resolution on the same active identity as default-key lookup.

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 getPublicKeyMaterial(keyId: String): WalletPublicKeyMaterial?

Reads only the descriptor's public material; no operational key is restored or authorized.

Link copied to clipboard
suspend fun importSoftwareKey(stored: StoredKey.Software): Key

Validates and persists an explicitly supplied software key.

Link copied to clipboard
open suspend override fun keyUseAuthorizationPolicy(keyId: String): KeyUseAuthorizationPolicy?

Returns the persisted policy for keyId, or null when the key does not exist.

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
suspend fun preflight(requirements: WalletKeyRequirements): KeyUseAuthorizationSupport

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.

Link copied to clipboard
fun storedKey(keyId: String): StoredKey?

Returns a validated descriptor to trusted identity/recovery services. It can contain private material.