AndroidBiometricAuthenticator

Android implementation of BiometricAuthenticator, backed by androidx.biometric.BiometricPrompt via BiometricDecryptionActivity.

This class owns all javax.crypto/java.security interaction internally — callers of BiometricAuthenticator never construct or pass a Cipher.

Parameters

promptInfo

the PromptInfo to display for each biometric challenge.

keyStore

the KeyStore used to look up private keys by alias.

Constructors

Link copied to clipboard
constructor(promptInfo: BiometricPrompt.PromptInfo, keyStore: KeyStore)

Functions

Link copied to clipboard
open suspend override fun decrypt(encryptedData: ByteArray, keyAlias: String): Result<ByteArray>

Performs a biometric authentication challenge bound to the key identified by keyAlias, then uses that key to decrypt encryptedData and returns the result.

open suspend override fun decrypt(encryptedData: ByteArray, keyAlias: String, iv: ByteArray): Result<ByteArray>

Performs a biometric authentication challenge bound to the key identified by keyAlias, then uses that key and iv to decrypt encryptedData and returns the result.

Link copied to clipboard
open suspend override fun unlock(): Result<Unit>

Performs a biometric authentication challenge with no associated cryptographic operation.