-
public final class YubiKitManagerStarting 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.
-
-
Constructor Summary
Constructors Constructor Description YubiKitManager(Context context)Initialize instance of YubiKitManager YubiKitManager(UsbYubiKeyManager usbYubiKeyManager, NfcYubiKeyManager nfcYubiKeyManager)Initialize an instance of YubiKitManager, providing the USB and NFC YubiKey managers touse for device discovery.
-
Method Summary
Modifier and Type Method Description voidstartUsbDiscovery(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 voidstartNfcDiscovery(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 voidstopUsbDiscovery()Unsubscribe from changes that happen via USB voidstopNfcDiscovery(Activity activity)Unsubscribe from changes that happen via NFC -
-
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 communicationnfcYubiKeyManager- 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 handledlistener- 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 handledactivity- active (not finished) activity required for nfc foreground dispatchlistener- 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
-
-
-
-