Ejemplo n.º 1
0
 def update_password(self, old_password, new_password):
     if old_password is not None:
         self.check_password(old_password)
     if new_password == '':
         new_password = None
     if self.has_seed():
         decoded = self.get_seed(old_password)
         self.seed = pw_encode(decoded, new_password)
     if self.xprv is not None:
         b = pw_decode(self.xprv, old_password)
         self.xprv = pw_encode(b, new_password)
Ejemplo n.º 2
0
 def update_password(self, old_password, new_password):
     self.check_password(old_password)
     if new_password == '':
         new_password = None
     if self.has_seed():
         decoded = self.get_seed(old_password)
         self.seed = pw_encode(decoded, new_password)
     if self.passphrase:
         decoded = self.get_passphrase(old_password)
         self.passphrase = pw_encode(decoded, new_password)
     if self.xprv is not None:
         b = pw_decode(self.xprv, old_password)
         self.xprv = pw_encode(b, new_password)
Ejemplo n.º 3
0
 def update_password(self, old_password, new_password):
     self.check_password(old_password)
     if new_password == '':
         new_password = None
     if self.has_seed():
         decoded = self.get_hex_seed(old_password)
         self.seed = pw_encode(decoded, new_password)
Ejemplo n.º 4
0
 def update_password(self, old_password, new_password):
     self.check_password(old_password)
     if new_password == '':
         new_password = None
     if self.has_seed():
         decoded = self.get_hex_seed(old_password)
         self.seed = pw_encode(decoded, new_password)
Ejemplo n.º 5
0
 def add_seed(self, seed, password):
     if self.seed:
         raise Exception("a seed exists")
     self.seed_version, self.seed = self.format_seed(seed)
     if password:
         self.seed = pw_encode(self.seed, password)
     self.use_encryption = (password is not None)
Ejemplo n.º 6
0
 def update_password(self, old_password, new_password):
     self.check_password(old_password)
     if new_password == '':
         new_password = None
     for k, v in self.keypairs.items():
         b = pw_decode(v, old_password)
         c = pw_encode(b, new_password)
         self.keypairs[k] = c
Ejemplo n.º 7
0
 def import_key(self, sec, password):
     try:
         pubkey = public_key_from_private_key(sec)
     except Exception:
         raise BaseException('Invalid private key')
     # allow overwrite
     self.keypairs[pubkey] = pw_encode(sec, password)
     return pubkey
Ejemplo n.º 8
0
 def update_password(self, old_password, new_password):
     self.check_password(old_password)
     if new_password == '':
         new_password = None
     for k, v in self.keypairs.items():
         b = pw_decode(v, old_password)
         c = pw_encode(b, new_password)
         self.keypairs[k] = c
Ejemplo n.º 9
0
 def import_key(self, sec, password):
     try:
         pubkey = public_key_from_private_key(sec)
     except Exception:
         raise BaseException('Invalid private key')
     # allow overwrite
     self.keypairs[pubkey] = pw_encode(sec, password)
     return pubkey
Ejemplo n.º 10
0
 def update_password(self, old_password, new_password):
     if old_password is not None:
         self.check_password(old_password)
     if new_password == '':
         new_password = None
     if self.has_seed():
         decoded = self.get_seed(old_password)
         self.seed = pw_encode(decoded, new_password)
     self.use_encryption = (new_password is not None)
Ejemplo n.º 11
0
 def update_password(self, old_password, new_password):
     if old_password is not None:
         self.check_password(old_password)
     if new_password == '':
         new_password = None
     for k, v in self.keypairs.items():
         b = pw_decode(v, old_password)
         c = pw_encode(b, new_password)
         self.keypairs[k] = b
     self.use_encryption = (new_password is not None)
Ejemplo n.º 12
0
 def add_master_private_key(self, xprv, password):
     self.xprv = pw_encode(xprv, password)