> ## Documentation Index
> Fetch the complete documentation index at: https://crossmint-devin-1787949784-wallet-docs-two-concept-model.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# DeviceSignerKeyStorage

> Kotlin Interface

**Interface**

```kotlin theme={null}
interface DeviceSignerKeyStorage
```

## Functions

| Function                       | Description                                                                                                                                                                                                  |
| ------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `deleteKey`                    | Deletes the signing key for the given wallet address.                                                                                                                                                        |
| `deletePendingKey`             | Deletes a pending key that was never mapped to a wallet address.                                                                                                                                             |
| `generateKey`                  | Generates a new P-256 signing key and stores it.                                                                                                                                                             |
| `getDeviceName`                | Returns the name of this device, for example "Pixel 10 Pro (Android)". The SDK uses this name as the display name of a device signer. If no device name is available, the function returns "Unknown Device". |
| `getKey`                       | Returns the base64-encoded uncompressed public key for the given wallet address, or null if not found.                                                                                                       |
| `getSecurityLevel`             | 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`                       | 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`                  | Returns true if this storage backend is available on the current device/platform.                                                                                                                            |
| `mapAddressToKey`              | Associates a previously generated pending key with a wallet address.                                                                                                                                         |
| `signHexMessage`               | Signs a hex-encoded message using the key for the given wallet address.                                                                                                                                      |
| `signHexMessageWithPendingKey` | Signs a hex-encoded message using a pending key (not yet mapped to a wallet address).                                                                                                                        |
| `signMessage`                  | Signs a base64-encoded message using the key for the given wallet address.                                                                                                                                   |

### deleteKey

```kotlin theme={null}
abstract suspend fun deleteKey(address: String): Result<Unit>
```

Deletes the signing key for the given wallet address.

### deletePendingKey

```kotlin theme={null}
abstract suspend fun deletePendingKey(publicKeyBase64: String): Result<Unit>
```

Deletes a pending key that was never mapped to a wallet address.

### generateKey

```kotlin theme={null}
abstract suspend fun generateKey(address: String?): Result<String>
```

Generates a new P-256 signing key and stores it.

### getDeviceName

```kotlin theme={null}
open suspend fun getDeviceName(): String
```

Returns the name of this device, for example "Pixel 10 Pro (Android)". The SDK uses this name as the display name of a device signer. If no device name is available, the function returns "Unknown Device".

### getKey

```kotlin theme={null}
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

```kotlin theme={null}
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

```kotlin theme={null}
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

```kotlin theme={null}
abstract suspend fun isAvailable(): Boolean
```

Returns true if this storage backend is available on the current device/platform.

### mapAddressToKey

```kotlin theme={null}
abstract suspend fun mapAddressToKey(address: String, publicKeyBase64: String): Result<Unit>
```

Associates a previously generated pending key with a wallet address.

### signHexMessage

```kotlin theme={null}
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

```kotlin theme={null}
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

```kotlin theme={null}
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.
