UserKeysStorage

class UserKeysStorage(config: UserKeyStorageConfig = UserKeyStorageConfig())

Manages persistent storage and retrieval of user key metadata for device binding operations.

This class provides a high-level interface for storing, retrieving, and managing UserKey metadata while abstracting the underlying storage implementation. It handles the complete lifecycle of user key information including creation, lookup, updates, and deletion.

The storage system maintains only metadata about cryptographic keys, not the actual private keys themselves, which remain securely stored in the Android KeyStore.

Parameters

config

The storage configuration specifying how and where to store user key metadata

See also

Constructors

Link copied to clipboard
constructor(config: UserKeyStorageConfig = UserKeyStorageConfig())

Types

Link copied to clipboard
object Companion

Companion object providing factory methods for creating UserKeysStorage instances.

Functions

Link copied to clipboard
suspend fun delete(userKey: UserKey)

Deletes a specific user key from storage.

Link copied to clipboard
suspend fun deleteByUserId(userId: String)

Deletes a user key by user ID.

Link copied to clipboard
suspend fun findAll(): List<UserKey>

Retrieves all stored user keys.

Link copied to clipboard
suspend fun findByUserId(userId: String): UserKey?

Finds a user key by user ID.

Link copied to clipboard
suspend fun save(userKey: UserKey)

Saves a user key, replacing any existing key for the same user.

Link copied to clipboard
suspend fun saveAll(userKeys: List<UserKey>)

Saves multiple user keys in a batch operation, adding only new users.