Class CommandState

java.lang.Object
com.yubico.yubikit.core.application.CommandState

public class CommandState
extends java.lang.Object
Provides control over an ongoing YubiKey operation.

Override onKeepAliveMessage to react to keepalive messages send periodically from the YubiKey. Call cancel() to cancel an ongoing operation.

  • Field Summary

    Fields 
    Modifier and Type Field Description
    static byte STATUS_PROCESSING  
    static byte STATUS_UPNEEDED  
  • Constructor Summary

    Constructors 
    Constructor Description
    CommandState()  
  • Method Summary

    Modifier and Type Method Description
    void cancel()
    Cancel an ongoing CTAP2 command, by sending a CTAP cancel command.
    void onKeepAliveStatus​(byte status)
    Override this method to handle keep-alive messages sent from the YubiKey.
    boolean waitForCancel​(long ms)  

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

  • Method Details

    • onKeepAliveStatus

      public void onKeepAliveStatus​(byte status)
      Override this method to handle keep-alive messages sent from the YubiKey. The default implementation will log the event.
      Parameters:
      status - The keep alive status byte
    • cancel

      public final void cancel()
      Cancel an ongoing CTAP2 command, by sending a CTAP cancel command. This will cause the YubiKey to return a CtapError with the error code 0x2d (ERR_KEEPALIVE_CANCEL).
    • waitForCancel

      public final boolean waitForCancel​(long ms)