Ejemplo n.º 1
0
    def find_state(self):
        client_wallet_obj = ClientWallet("somepassword")
        print "wallet exists"
        print client_wallet_obj.wallet_exists()

        if client_wallet_obj.wallet_exists():
             self.sm.current = "openwallet"
        else:
             self.sm.current = "createwallet"
Ejemplo n.º 2
0
def create_wallet(wallet_type, key, logger):
    if wallet_type == 'ServerWallet':
        wallet = ServerWallet(key, logger)
    elif wallet_type == 'ClientWallet':
        wallet = ClientWallet(key)
    else:
        wallet = PlainWallet()
    wallet.instance()
    return wallet
Ejemplo n.º 3
0
def create_wallet(wallet_type, key, logger):
    if wallet_type == 'ServerWallet':
        wallet = ServerWallet(key, logger)
    elif wallet_type == 'ClientWallet':
        wallet = ClientWallet(key)
    elif wallet_type == 'MemoryWallet':
        wallet = MemoryWallet(key)  # Used for file encryption
    else:
        wallet = PlainWallet()
    wallet.instance()
    return wallet
from notary_client import Notary
import simplecrypt
from client_wallet import ClientWallet
import test_data

# create a wallet
notary_obj = Notary(test_data.config_file_name, "test123")

# load wallet with wrong password
try:
    notary_obj = Notary(test_data.config_file_name, "tessfsdft123")
except simplecrypt.DecryptionException as e:
    print e.message

# test wallet exists are not.
client_wallet_obj = ClientWallet("somepassword")
print "wallet exists"
print client_wallet_obj.wallet_exists()
#test wallet is registered or not.
#test wallet is confirmed or not.
#test register to server.
print "registering wallet"
print notary_obj.register_user(test_data.email_address)
print "getting register status"
print notary_obj.register_user_status()
#test register to server agin.
print "testing register again"
print notary_obj.register_user(test_data.email_address)
print "getting register status"
print notary_obj.register_user_status()
print (raw_input('Finish confirmation and click'))
Ejemplo n.º 5
0
#try to authenticate without anything.
print "try to authenticate without anything"
try:
    print notary_obj.authenticate()
except NotaryException as e:
    print("Code %s " % e.error_code)
    print(e.message)
# load wallet with wrong password


try:
    notary_obj = NotaryClient(test_data.config_file_name, "tessfsdft123")
except simplecrypt.DecryptionException as e:
    print e.message
# test wallet exists are not.
client_wallet_obj = ClientWallet("somepassword")
print "wallet exists"
print client_wallet_obj.wallet_exists()
#test wallet is registered or not.
#test wallet is confirmed or not.
#test register to server.
print "registering wallet"
try:
    print notary_obj.register_user(test_data.email_address)
except NotaryException as e:
    print("Code %s " % e.error_code)
    print(e.message)
print "try authentication without confirmation"
try:
    print notary_obj.authenticate()
except NotaryException as e: