Package 

Class YubiKitManager


  • 
    public final class YubiKitManager
    
                        

    Starting point for YubiKey device discovery over both USB and NFC. Use this class to listen for YubiKeys and get a com.yubico.yubikit.core.YubiKeyDevice reference.

    • Method Summary

      Modifier and Type Method Description
      void startUsbDiscovery(UsbConfiguration usbConfiguration, Callback<out Object> listener) Subscribe on changes that happen via USB and detect if there any Yubikeys got connectedThis registers broadcast receivers, to unsubscribe from receiver use
      void startNfcDiscovery(NfcConfiguration nfcConfiguration, Activity activity, Callback<out Object> listener) Subscribe on changes that happen via NFC and detect if there any Yubikeys tags got passedThis registers broadcast receivers and blocks Ndef tags to be passed to activity, tounsubscribe use stopNfcDiscovery
      void stopUsbDiscovery() Unsubscribe from changes that happen via USB
      void stopNfcDiscovery(Activity activity) Unsubscribe from changes that happen via NFC
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • YubiKitManager

        YubiKitManager(Context context)
        Initialize instance of YubiKitManager
        Parameters:
        context - application context
      • YubiKitManager

        YubiKitManager(UsbYubiKeyManager usbYubiKeyManager, NfcYubiKeyManager nfcYubiKeyManager)
        Initialize an instance of YubiKitManager, providing the USB and NFC YubiKey managers touse for device discovery.
        Parameters:
        usbYubiKeyManager - UsbYubiKeyManager instance to use for USB communication
        nfcYubiKeyManager - NfcYubiKeyManager instance to use for NFC communication
    • Method Detail

      • startUsbDiscovery

         void startUsbDiscovery(UsbConfiguration usbConfiguration, Callback<out Object> listener)

        Subscribe on changes that happen via USB and detect if there any Yubikeys got connected

        This registers broadcast receivers, to unsubscribe from receiver use

        Parameters:
        usbConfiguration - additional configurations on how USB discovery should be handled
        listener - listener that is going to be invoked upon successful discovery of key sessionor failure to detect any session (lack of permissions)
      • startNfcDiscovery

         void startNfcDiscovery(NfcConfiguration nfcConfiguration, Activity activity, Callback<out Object> listener)

        Subscribe on changes that happen via NFC and detect if there any Yubikeys tags got passed

        This registers broadcast receivers and blocks Ndef tags to be passed to activity, tounsubscribe use stopNfcDiscovery

        Parameters:
        nfcConfiguration - additional configurations on how NFC discovery should be handled
        activity - active (not finished) activity required for nfc foreground dispatch
        listener - listener that is going to be invoked upon successful discovery of YubiKeys orfailure to detect any device (setting if off or no nfc adapter on device)
      • stopUsbDiscovery

         void stopUsbDiscovery()

        Unsubscribe from changes that happen via USB

      • stopNfcDiscovery

         void stopNfcDiscovery(Activity activity)

        Unsubscribe from changes that happen via NFC

        Parameters:
        activity - active (not finished) activity required for nfc foreground dispatch