Skip to main content
Interface
interface DeviceSignerKeyStorage

Functions

deleteKey

abstract suspend fun deleteKey(address: String): Result<Unit>
Deletes the signing key for the given wallet address.

deletePendingKey

abstract suspend fun deletePendingKey(publicKeyBase64: String): Result<Unit>
Deletes a pending key that was never mapped to a wallet address.

generateKey

abstract suspend fun generateKey(address: String?): Result<String>
Generates a new P-256 signing key and stores it.

getKey

abstract suspend fun getKey(address: String): String?
Returns the base64-encoded uncompressed public key for the given wallet address, or null if not found.

getSecurityLevel

abstract suspend fun getSecurityLevel(address: String): String?
Returns a human-readable string describing the security level of the key for the given wallet address (e.g. “StrongBox”, “TEE”, “Software”), or null if the key is not found.

hasKey

abstract suspend fun hasKey(publicKeyBase64: String): Boolean
Returns true if this storage holds a key for the given uncompressed public key (base64-encoded). Used during wallet initialization to detect whether a registered device signer belongs to this device.

isAvailable

abstract suspend fun isAvailable(): Boolean
Returns true if this storage backend is available on the current device/platform.

mapAddressToKey

abstract suspend fun mapAddressToKey(address: String, publicKeyBase64: String): Result<Unit>
Associates a previously generated pending key with a wallet address.

signHexMessage

abstract suspend fun signHexMessage(address: String, hexMessage: String): Result<Pair<String, String>>
Signs a hex-encoded message using the key for the given wallet address.

signHexMessageWithPendingKey

abstract suspend fun signHexMessageWithPendingKey(publicKeyBase64: String, hexMessage: String): Result<Pair<String, String>>
Signs a hex-encoded message using a pending key (not yet mapped to a wallet address).

signMessage

abstract suspend fun signMessage(address: String, message: String): Result<Pair<String, String>>
Signs a base64-encoded message using the key for the given wallet address.