HardwareKeyStore
Non-exportable ECDSA P-256 signing keys generated inside the platform's secure hardware: StrongBox or the trusted execution environment on Android, and the Secure Enclave on Apple platforms. Private keys never leave the hardware; callers receive the public key and signatures only.
By default generate fails with KeychainUnavailableException.Reason.Unsupported when no secure hardware is available (emulators, simulators, unsigned macOS tools, desktop JVM). Opt in to software-backed keys with HardwareKeySpec.allowSoftwareKeys; HardwareKeyInfo.securityLevel always reports the level actually obtained.
Signatures use ECDSA with SHA-256 over the supplied data and are DER-encoded (X9.62), so they verify with SHA256withECDSA on the JVM and ecdsaSignatureMessageX962SHA256 on Apple platforms. Keys are isolated by the store's service/account namespace, like the other stores.
val keys = HardwareKeyStore.forCurrentPlatform(serviceName = "my-app", accountName = "user-123")
val key = keys.generate("device-binding")
upload(key.publicKeyDer)
val signature: ByteArray? = keys.sign("device-binding", challenge)