register

suspend fun register(input: JsonObject, block: FidoRegistrationCustomizer.() -> Unit = {}): Result<JsonObject>

Registers a new FIDO credential using Android Credential Manager.

This method creates a new FIDO2 credential (passkey) on the device using the Android Credential Manager API. The credential can be stored locally on the device or synced across devices depending on platform capabilities and user preferences.

Registration Process:

  1. Validates the credential creation request

  2. Prompts user for authentication (biometric, PIN, etc.)

  3. Generates cryptographic key pair on secure hardware

  4. Creates attestation response with public key and metadata

  5. Returns formatted response compatible with WebAuthn standards

Credential Storage:

  • Local: Stored in device's secure hardware (TPM/Secure Enclave)

  • Synced: May sync across user's devices via platform provider

  • Discoverable: Can be used without explicit credential ID

Return

A Result containing the attestation response as a JsonObject on success, or an exception on failure. The response includes the public key, attestation data, and client data JSON.

Parameters

input

The credential creation options including user info, relying party details, and cryptographic preferences