AndroidKeystoreSigningDriver

P-256 keys generated inside the Android Keystore: the private key is non-exportable and every signature is produced by the secure hardware.

Tries StrongBox (a dedicated tamper-resistant element, API 28+) first and falls back to the TEE-backed keystore — the path most devices take, since many capable SoCs ship without the StrongBox HAL enabled. securityLevel reports where the key actually landed; render it honestly rather than claiming StrongBox everywhere. Pass requireStrongBox = true to fail instead of falling back.

Keys are addressed by alias and live in the keystore across launches — store the alias (e.g. as a io.github.vsima.canton.wallet.WalletRecord key handle) and load it on the next start.

Types

Link copied to clipboard
object Companion

Keystore lifecycle: generate, load, delete.

Link copied to clipboard

The hardware tier holding a key, strongest first.

Properties

Link copied to clipboard

The keystore alias the key lives under — the value to persist as a key handle and pass to load.

Link copied to clipboard

True when the key cannot leave secure hardware.

Link copied to clipboard

Where the key actually landed, as the platform reports it.

Functions

Link copied to clipboard
open suspend override fun publicKey(): CryptoOuterClass.SigningPublicKey
Link copied to clipboard
open suspend override fun sign(bytes: ByteArray): CryptoOuterClass.Signature