2016-07-02 08:58:56 +02:00
|
|
|
from ..trezor.plugin import TrezorCompatiblePlugin, TrezorCompatibleKeyStore
|
2015-08-10 23:27:42 -07:00
|
|
|
|
|
|
|
|
|
2016-07-02 08:58:56 +02:00
|
|
|
class KeepKey_KeyStore(TrezorCompatibleKeyStore):
|
2016-08-21 22:15:17 +02:00
|
|
|
hw_type = 'keepkey'
|
2015-12-26 16:25:10 +09:00
|
|
|
device = 'KeepKey'
|
2015-11-23 14:15:25 +01:00
|
|
|
|
|
|
|
|
|
2015-12-26 19:42:57 +09:00
|
|
|
class KeepKeyPlugin(TrezorCompatiblePlugin):
|
2015-12-27 13:56:50 +09:00
|
|
|
firmware_URL = 'https://www.keepkey.com'
|
|
|
|
|
libraries_URL = 'https://github.com/keepkey/python-keepkey'
|
|
|
|
|
minimum_firmware = (1, 0, 0)
|
2016-07-02 08:58:56 +02:00
|
|
|
keystore_class = KeepKey_KeyStore
|
2016-08-15 12:28:31 +02:00
|
|
|
|
|
|
|
|
def __init__(self, *args):
|
|
|
|
|
try:
|
|
|
|
|
import client
|
|
|
|
|
import keepkeylib
|
|
|
|
|
import keepkeylib.ckd_public
|
|
|
|
|
import keepkeylib.transport_hid
|
|
|
|
|
self.client_class = client.KeepKeyClient
|
|
|
|
|
self.ckd_public = keepkeylib.ckd_public
|
|
|
|
|
self.types = keepkeylib.client.types
|
|
|
|
|
self.DEVICE_IDS = keepkeylib.transport_hid.DEVICE_IDS
|
|
|
|
|
self.libraries_available = True
|
|
|
|
|
except ImportError:
|
|
|
|
|
self.libraries_available = False
|
|
|
|
|
TrezorCompatiblePlugin.__init__(self, *args)
|
|
|
|
|
|
|
|
|
|
def hid_transport(self, pair):
|
|
|
|
|
from keepkeylib.transport_hid import HidTransport
|
|
|
|
|
return HidTransport(pair)
|
|
|
|
|
|
|
|
|
|
def bridge_transport(self, d):
|
|
|
|
|
raise NotImplementedError('')
|