Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

getSymmetricKey() is null #11

Open
eitanaviv opened this issue May 8, 2018 · 2 comments
Open

getSymmetricKey() is null #11

eitanaviv opened this issue May 8, 2018 · 2 comments

Comments

@eitanaviv
Copy link

Hi there,
After calling generateSymmetricKey() for the first time the user's runs the app, and when reopening the app i'm calling getSymmetricKey() everything seems to be working fine.
But when restarting the device, getSymmetricKey() return null and app stops working of course.
I'm using this library with Realm.

My code:

Store store = new Store(getApplicationContext());
        Crypto crypto = new Crypto(Options.TRANSFORMATION_SYMMETRIC);
        SecretKey key;

        if (!store.hasKey(getALString())) {
            freshStart = true;

            key = store.generateSymmetricKey(getALString(), null);
        } else {
            freshStart = false;

            key = store.getSymmetricKey(getALString(), null);
        }

The above code get called on: public class MyApplication extends MultiDexApplication

Appreciate the help.

@yakivmospan
Copy link
Owner

Hello, thanks for your reply, can you please provide information about the API level of the device you are facing this issue on?

@rviannaoliveira
Copy link

I have that same problem too.

could you help?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants