Exemplo n.º 1
0
 def __del__(self):
     YubiKey.__del__(self)
     try:
         if self._usb_handle:
             self._close()
     except usb.USBError:
         pass
Exemplo n.º 2
0
    def __init__(self, debug=False, skip=0):
        """
        Find and connect to a USB HIB YubiKey.

        Attributes :
            skip  -- number of YubiKeys to skip
            debug -- True or False
        """
        YubiKey.__init__(self, debug)
        self._usb_handle = None
        if not self._open(skip):
            raise YubiKeyUSBHIDError('YubiKey USB HID initialization failed')
        self.status()
Exemplo n.º 3
0
    def __init__(self, debug=False, skip=0):
        """
        Find and connect to a YubiKey (USB HID).

        Attributes :
            skip  -- number of YubiKeys to skip
            debug -- True or False
        """
        YubiKey.__init__(self, debug)
        self._usb_handle = None
        if not self._open(skip):
            raise YubiKeyUSBHIDError('YubiKey USB HID initialization failed')
        self.status()
        self.capabilities = \
            YubiKeyUSBHIDCapabilities(model = self.model, \
                                          version = self.version_num(), \
                                          default_answer = False)
Exemplo n.º 4
0
    def __init__(self, debug=False, skip=0):
        """
        Find and connect to a YubiKey (USB HID).

        Attributes :
            skip  -- number of YubiKeys to skip
            debug -- True or False
        """
        YubiKey.__init__(self, debug)
        self._usb_handle = None
        if not self._open(skip):
            raise YubiKeyUSBHIDError('YubiKey USB HID initialization failed')
        self.status()
        self.capabilities = \
            YubiKeyUSBHIDCapabilities(model = self.model, \
                                          version = self.version_num(), \
                                          default_answer = False)