GetAddressFromKeyStore() public method

public GetAddressFromKeyStore ( string json ) : string
json string
return string
Exemplo n.º 1
0
    public void ImportAccountFromJson(string password, string encryptedJson)
    {
        var keystoreservice = new Nethereum.KeyStore.KeyStoreService();

        var privateKey = keystoreservice.DecryptKeyStoreFromJson(password, encryptedJson);

        var address = keystoreservice.GetAddressFromKeyStore(encryptedJson);

        this.password      = password;
        this.publicAddress = address;
        this.privateKey    = ConvertKey(privateKey);
        this.encryptedJson = encryptedJson;
    }
Exemplo n.º 2
0
    public void ImportAccountFromJson(string password, string encryptedJson)
    {
        try
        {
            var keystoreservice = new Nethereum.KeyStore.KeyStoreService();
            var privateKey      = keystoreservice.DecryptKeyStoreFromJson(password, encryptedJson);
            var address         = keystoreservice.GetAddressFromKeyStore(encryptedJson);

            this.password      = password;
            this.publicAddress = address;
            this.privateKey    = ConvertKey(privateKey);
            this.encryptedJson = encryptedJson;
        }
        catch (DecryptionException ex)
        {
            Debug.Log("DecryptionException");
            FindObjectOfType <AccountManager>().passwordNotice.enabled = true;
            return;
        }
    }