Beispiel #1
0
 def on_restore_pw(self, wizard, seed, passphrase, password, encrypt_storage):
     xprv1, xpub1, xprv2, xpub2 = self.xkeys_from_seed(seed, passphrase)
     k1 = keystore.from_xprv(xprv1)
     k2 = keystore.from_xprv(xprv2)
     k1.add_seed(seed)
     k1.update_password(None, password)
     k2.update_password(None, password)
     wizard.data['x1/'] = k1.dump()
     wizard.data['x2/'] = k2.dump()
     long_user_id, short_id = get_user_id(wizard.data)
     xtype = xpub_type(xpub1)
     xpub3 = make_xpub(get_signing_xpub(xtype), long_user_id)
     k3 = keystore.from_xpub(xpub3)
     wizard.data['x3/'] = k3.dump()
     wizard.pw_args = password, encrypt_storage, STO_EV_USER_PW
     wizard.terminate()
Beispiel #2
0
 def create_keystore(self, wizard, seed, passphrase):
     # this overloads the wizard's method
     xprv1, xpub1, xprv2, xpub2 = self.xkeys_from_seed(seed, passphrase)
     k1 = keystore.from_xprv(xprv1)
     k2 = keystore.from_xpub(xpub2)
     wizard.request_password(run_next=lambda pw, encrypt: self.on_password(
         wizard, pw, encrypt, k1, k2))
 def on_restore_pw(self, wizard, seed, passphrase, password, encrypt_storage):
     xprv1, xpub1, xprv2, xpub2 = self.xkeys_from_seed(seed, passphrase)
     k1 = keystore.from_xprv(xprv1)
     k2 = keystore.from_xprv(xprv2)
     k1.add_seed(seed)
     k1.update_password(None, password)
     k2.update_password(None, password)
     wizard.data['x1/'] = k1.dump()
     wizard.data['x2/'] = k2.dump()
     long_user_id, short_id = get_user_id(wizard.data)
     xtype = xpub_type(xpub1)
     xpub3 = make_xpub(get_signing_xpub(xtype), long_user_id)
     k3 = keystore.from_xpub(xpub3)
     wizard.data['x3/'] = k3.dump()
     wizard.pw_args = password, encrypt_storage, STO_EV_USER_PW
     wizard.terminate()
 def create_keystore(self, wizard, seed, passphrase):
     xprv1, xpub1, xprv2, xpub2 = self.xkeys_from_seed(seed, passphrase)
     # 创建钱包所需的公钥
     k1 = keystore.from_xprv(xprv1)
     k2 = keystore.from_xpub(xpub2)
     wizard.request_password(run_next=lambda pw, encrypt: self.on_password(
         wizard, pw, encrypt, k1, k2))
Beispiel #5
0
 def on_restore_pw(self, wizard, seed, passphrase, password):
     storage = wizard.storage
     xprv1, xpub1, xprv2, xpub2 = self.xkeys_from_seed(seed, passphrase)
     k1 = keystore.from_xprv(xprv1)
     k2 = keystore.from_xprv(xprv2)
     k1.add_seed(seed)
     k1.update_password(None, password)
     k2.update_password(None, password)
     storage.put('x1/', k1.dump())
     storage.put('x2/', k2.dump())
     long_user_id, short_id = get_user_id(storage)
     xpub3 = make_xpub(signing_xpub, long_user_id)
     k3 = keystore.from_xpub(xpub3)
     storage.put('use_encryption', bool(password))
     storage.put('x3/', k3.dump())
     wizard.wallet = Wallet_2fa(storage)
     wizard.create_addresses()
Beispiel #6
0
 def on_restore_pw(self, wizard, seed, passphrase, password, encrypt):
     storage = wizard.storage
     xprv1, xpub1, xprv2, xpub2 = self.xkeys_from_seed(seed, passphrase)
     k1 = keystore.from_xprv(xprv1)
     k2 = keystore.from_xprv(xprv2)
     k1.add_seed(seed)
     k1.update_password(None, password)
     k2.update_password(None, password)
     storage.put('x1/', k1.dump())
     storage.put('x2/', k2.dump())
     long_user_id, short_id = get_user_id(storage)
     xpub3 = make_xpub(signing_xpub, long_user_id)
     k3 = keystore.from_xpub(xpub3)
     storage.put('x3/', k3.dump())
     storage.set_password(password, encrypt)
     wizard.wallet = Wallet_2fa(storage)
     wizard.create_addresses()
 def on_restore_pw(self, wizard, seed, passphrase, password, encrypt_storage):
     xprv1, xpub1, xprv2, xpub2 = self.xkeys_from_seed(seed, passphrase)
     k1 = keystore.from_xprv(xprv1)
     k2 = keystore.from_xprv(xprv2)
     k1.add_seed(seed)
     k1.update_password(None, password)
     k2.update_password(None, password)
     wizard.data['x1/'] = k1.dump()
     wizard.data['x2/'] = k2.dump()
     long_user_id, short_id = get_user_id(wizard.data)
     xtype = xpub_type(xpub1)
     xpub3 = make_xpub(get_signing_xpub(xtype), long_user_id)
     k3 = keystore.from_xpub(xpub3)
     wizard.data['x3/'] = k3.dump()
     wizard.pw_args = WizardWalletPasswordSetting(password=password,
                                                  encrypt_storage=encrypt_storage,
                                                  storage_enc_version=StorageEncryptionVersion.USER_PASSWORD,
                                                  encrypt_keystore=bool(password))
     wizard.terminate()
Beispiel #8
0
    def on_restore_pw(self, wizard, seed, passphrase, password, encrypt_storage):
        storage = wizard.storage
        xprv1, xpub1, xprv2, xpub2 = self.xkeys_from_seed(seed, passphrase)
        k1 = keystore.from_xprv(xprv1)
        k2 = keystore.from_xprv(xprv2)
        k1.add_seed(seed)
        k1.update_password(None, password)
        k2.update_password(None, password)
        storage.put('x1/', k1.dump())
        storage.put('x2/', k2.dump())
        long_user_id, short_id = get_user_id(storage)
        xtype = xpub_type(xpub1)
        xpub3 = make_xpub(get_signing_xpub(xtype), long_user_id)
        k3 = keystore.from_xpub(xpub3)
        storage.put('x3/', k3.dump())

        storage.set_keystore_encryption(bool(password))
        if encrypt_storage:
            storage.set_password(password, enc_version=STO_EV_USER_PW)

        wizard.wallet = Wallet_2fa(storage)
        wizard.create_addresses()
Beispiel #9
0
    def on_restore_pw(self, wizard, seed, passphrase, password, encrypt_storage):
        storage = wizard.storage
        xprv1, xpub1, xprv2, xpub2 = self.xkeys_from_seed(seed, passphrase)
        k1 = keystore.from_xprv(xprv1)
        k2 = keystore.from_xprv(xprv2)
        k1.add_seed(seed)
        k1.update_password(None, password)
        k2.update_password(None, password)
        storage.put('x1/', k1.dump())
        storage.put('x2/', k2.dump())
        long_user_id, short_id = get_user_id(storage)
        xtype = xpub_type(xpub1)
        xpub3 = make_xpub(get_signing_xpub(xtype), long_user_id)
        k3 = keystore.from_xpub(xpub3)
        storage.put('x3/', k3.dump())

        storage.set_keystore_encryption(bool(password))
        if encrypt_storage:
            storage.set_password(password, enc_version=STO_EV_USER_PW)

        wizard.wallet = Wallet_2fa(storage)
        wizard.create_addresses()
Beispiel #10
0
 def create_keystore(self, wizard, seed, passphrase):
     # this overloads the wizard's method
     xprv1, xpub1, xprv2, xpub2 = self.xkeys_from_seed(seed, passphrase)
     k1 = keystore.from_xprv(xprv1)
     k2 = keystore.from_xpub(xpub2)
     wizard.request_password(run_next=lambda pw, encrypt: self.on_password(wizard, pw, encrypt, k1, k2))