File: //lib/python3.6/site-packages/yubico/__pycache__/yubikey.cpython-36.opt-1.pyc
3
y@�Vr � @ sv d Z ddddddgZddlmZ dd lmZmZmZmZm Z dd
l
mZmZm
Z
ddlmZ ddlmZ ddd�ZdS )a+
module for accessing a YubiKey
In an attempt to support any future versions of the YubiKey which
might not be USB HID devices, you should always use the yubikey.find_key()
(or better yet, yubico.find_yubikey()) function to initialize
communication with YubiKeys.
Example usage (if using this module directly, see base module yubico) :
import yubico.yubikey
try:
YK = yubico.yubikey.find_key()
print "Version : %s " % YK.version()
except yubico.yubico_exception.YubicoError as inst:
print "ERROR: %s" % inst.reason
ZRESP_TIMEOUT_WAIT_FLAGZRESP_PENDING_FLAGZSLOT_WRITE_FLAG�find_key�YubiKey�YubiKeyTimeout� )�__version__)�YubiKeyErrorr �YubiKeyVersionError�YubiKeyCapabilitiesr )�
YubiKeyUSBHID�YubiKeyHIDDevice�YubiKeyUSBHIDError)�YubiKeyNEO_USBHID)�YubiKey4_USBHIDF� c C s� ynt | |�}|j� j� }d
| ko*dkn r<t| ||�S |dk rPt| ||�S |d
k rdt| ||�S t| ||�S tk
r� } zdt|�kr�td��n� W Y d d }~X nX d S )a
Locate a connected YubiKey. Throws an exception if none is found.
This function is supposed to be possible to extend if any other YubiKeys
appear in the future.
Attributes :
skip -- number of YubiKeys to skip
debug -- True or False
� r � � � r zNo USB YubiKey foundzNo YubiKey foundN)r r r )r r r )r r r )r r r ) r
ZstatusZykverr r r
r �strr )�debug�skipZ
hid_deviceZ
yk_versionZinst� r �/usr/lib/python3.6/yubikey.pyr ) s
N)Fr )�__doc__�__all__Zyubico_versionr Zyubikey_baser r r r r Zyubikey_usb_hidr r
r Zyubikey_neo_usb_hidr Zyubikey_4_usb_hidr
r r r r r �<module> s