Interface KeyboardCallback


public interface KeyboardCallback
A callback for receiving events from the secure keyboard.
Since:
1.0.0
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    onAuthenticationFailed(int retryCountRemaining)
    Called when a passcode authentication attempt fails but the user still has attempts remaining.
    void
    Called when a key is pressed on the keyboard.
    void
    Called when the passcode input on the keyboard fails the passcode rule validation.
    void
    Called when the purpose of the keyboard changes (e.g., from entering a new passcode to confirming it).
  • Method Details

    • onKeyReceived

      @MainThread void onKeyReceived(KeyboardKey key)
      Called when a key is pressed on the keyboard.

      The application should use this callback to update its UI, such as displaying dots for each entered digit.

      Key examples include:
      KeyboardKey.INPUT - Add a new secure character (⬤) to the text field entry.
      KeyboardKey.DELETE - Remove a secure character from the text field entry.
      KeyboardKey.DONE - Passcode entry is submitted to the FIDO SDK.

      This method is called on the main thread.
      Parameters:
      key - An enum of type KeyboardKey indicating the type of key pressed.
      Since:
      1.0.0
    • onAuthenticationFailed

      @MainThread void onAuthenticationFailed(int retryCountRemaining)
      Called when a passcode authentication attempt fails but the user still has attempts remaining.

      The retry count limit is configured via Fido2Config.setMaximumRetryCount(int). If the user exceeds this limit, a Fido2Exception with the error code Fido2ErrorCode.ERROR_USER_LOCKOUT is thrown. The retry count resets upon a successful authentication.

      The entered passcode is automatically cleared after a failed attempt.

      This method is called on the main thread.
      Parameters:
      retryCountRemaining - The number of remaining authentication attempts.
      Since:
      1.0.0
    • onPasscodeRuleFailed

      @MainThread void onPasscodeRuleFailed(Fido2Exception exception)
      Called when the passcode input on the keyboard fails the passcode rule validation.

      This method is called on the main thread.

      Parameters:
      exception - A Fido2Exception containing a PasscodeRuleException as its cause, which provides details about the specific rule violation.
      Since:
      1.3.0
    • onUsageChanged

      @MainThread void onUsageChanged(KeyboardUsage usage)
      Called when the purpose of the keyboard changes (e.g., from entering a new passcode to confirming it). This method is called on the main thread.
      Parameters:
      usage - An enum of type KeyboardUsage indicating what the keyboard is used for
      Since:
      1.0.0