yakivmospan / scytale

One tool to manage key generation, key storing and encryption on different APIs of Android.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

not picking up a stored key.. heres the code

johnda98 opened this issue · comments

 Toast.makeText(getApplicationContext(), pinview.getValue(), Toast.LENGTH_LONG).show();
            String pin = "78454";

            SecretKey key;

            if (pinview.getValue().equals(pin)) {

                // New Install - got geninstall Activity to get new PIN confirm &
                // obtain a new HH account
                //
                // with an option to generate new account and key from platform 0.0.8660 account

                key = store.generateSymmetricKey("78454", null);

                // openActivityinstallacc();

            } else {

                // check to see if pin and keys in store, if so then open wallet
                // and get existing account and key

                if (store.hasKey("78454"))
                {
                    openActivityhbal();
                }

** I create the key 78454 and put it to store ... then on re-opening app.. doesnt find 78454 in the store

This is on the studio emulator.. presume keystore works on the emulator ALSO it seems Store is not an extension of Application and thus passing the object via getApplicationContext also cannot be cast

seems to be working now.. studio does odd things.. have to exit and reboot