DeviceAuthenticator

Interface for device authenticators that handle cryptographic operations for device binding. Implementations provide device-specific authentication mechanisms such as biometric authentication, PIN-based authentication, or hardware security modules.

Inheritors

Properties

Link copied to clipboard

The type of device binding authentication this authenticator provides.

Functions

Link copied to clipboard
abstract suspend fun authenticate(context: Context = ContextProvider.context): Result<Pair<PrivateKey, BiometricPrompt.CryptoObject?>>

Authenticates the user and retrieves the private key for signing operations.

Link copied to clipboard
abstract suspend fun deleteKeys()

Deletes all keys associated with this authenticator from the device.

Link copied to clipboard
open fun isSupported(context: Context, attestation: Attestation = Attestation.None): Boolean

Checks if this authenticator is supported on the current device.

Link copied to clipboard
abstract suspend fun register(context: Context = ContextProvider.context, attestation: Attestation): Result<KeyPair>

Registers a new key pair for device binding with optional attestation.

Link copied to clipboard
open fun sign(params: SigningParameters): String

Signs a JWT using the provided signing parameters and key pair. Creates a signed JWT with standard claims including platform information and challenge.

Signs a JWT using user key signing parameters with custom claims support. Creates a signed JWT with the specified user key and custom claims.