Exemplo n.º 1
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
Exemplo 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)
    elif wallet_type == 'MemoryWallet':
        wallet = MemoryWallet(key)  # Used for file encryption
    else:
        wallet = PlainWallet()
    wallet.instance()
    return wallet
Exemplo n.º 3
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: