KeyStore

interface KeyStore(source)

The wallet's keys: P-256 keys whose private halves never leave the store (Android Keystore). An exception it throws reaches Go and comes back as a WalletException.Code.platform error. Go calls it on its own thread, never the main one.

Inheritors

Properties

Link copied to clipboard
open val isDurable: Boolean

Whether keys survive the app quitting. Receiving credentials needs a durable store unless the configuration is for development.

Functions

Link copied to clipboard
abstract fun createKey(purpose: KeyPurpose): String

Creates a P-256 key for purpose and returns its ID.

Link copied to clipboard
abstract fun deleteKey(id: String)

Deletes the key; deleting one that doesn't exist isn't an error.

Link copied to clipboard
abstract fun publicKey(id: String): ByteArray?

The key's public key as an uncompressed X9.63 point (0x04 || X || Y), or null when there's no such key.

Link copied to clipboard
abstract fun sign(id: String, digest: ByteArray): ByteArray

Signs a SHA-256 digest with the key, returning an ASN.1 DER ECDSA signature. A holder key may ask the holder to authenticate here.