def set_password(self, password): for key in self._keys: self._key_manager.save_key(crypto.encrypt_key(key, password))
def it_reencrypts_keys_with_new_password(self): key = self.get_key() decrypted_key = crypto.decrypt_key(key, 'masterpassword123') encrypted_key = crypto.encrypt_key(decrypted_key, 'new_and_better_password') crypto.decrypt_key(encrypted_key, 'new_and_better_password')