Class UsbYubiKeyDevice
-
- All Implemented Interfaces:
-
com.yubico.yubikit.core.YubiKeyDevice,java.io.Closeable,java.lang.AutoCloseable
public class UsbYubiKeyDevice implements YubiKeyDevice, Closeable
-
-
Field Summary
Fields Modifier and Type Field Description public final UsbDeviceusbDevicepublic final static intYUBICO_VENDOR_ID
-
Constructor Summary
Constructors Constructor Description UsbYubiKeyDevice(UsbManager usbManager, UsbDevice usbDevice)Creates the instance of usb session to interact with the yubikey device.
-
Method Summary
Modifier and Type Method Description UsbDevicegetUsbDevice()Returns yubikey device attached to the android device with the android device acting as the USB host. booleanhasPermission()UsbPidgetPid()TransportgetTransport()booleansupportsConnection(Class<out YubiKeyConnection> connectionType)<T extends YubiKeyConnection> voidrequestConnection(Class<T> connectionType, Callback<Result<T, IOException>> callback)<T extends YubiKeyConnection> TopenConnection(Class<T> connectionType)voidclose()StringtoString()voidsetOnClosed(Runnable onClosed)-
-
Constructor Detail
-
UsbYubiKeyDevice
UsbYubiKeyDevice(UsbManager usbManager, UsbDevice usbDevice)
Creates the instance of usb session to interact with the yubikey device.
- Parameters:
usbManager- UsbManager for accessing USB devicesusbDevice- device connected over usb that has permissions to interact with
-
-
Method Detail
-
getUsbDevice
UsbDevice getUsbDevice()
Returns yubikey device attached to the android device with the android device acting as the USB host. It describes the capabilities of the USB device and allows to get properties/name/product id/manufacturer of device
- Returns:
yubikey device connected over USB
-
hasPermission
boolean hasPermission()
-
getPid
UsbPid getPid()
- Returns:
UsbPid for the device's product id
-
getTransport
Transport getTransport()
-
supportsConnection
boolean supportsConnection(Class<out YubiKeyConnection> connectionType)
-
requestConnection
<T extends YubiKeyConnection> void requestConnection(Class<T> connectionType, Callback<Result<T, IOException>> callback)
-
openConnection
<T extends YubiKeyConnection> T openConnection(Class<T> connectionType)
-
close
void close()
-
setOnClosed
void setOnClosed(Runnable onClosed)
-
-
-
-