-
Notifications
You must be signed in to change notification settings - Fork 22
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
java.security.InvalidKeyException: Key for algorithm RSA not suitable for symmetric encryption on API < 23 #34
Comments
No, you are not misusing It: what's the device os version and app's target sdk? |
I'm using an emulator - don't have a physical device of this Android version to test on. Perhaps related? It works fine on the emulator on more recent Android versions. App's target sdk is 30, and here's the output of the AVD Manager "View details":
|
Yep, I check back to be sure and the behaviour is definitely different if not running at least Android M (23). Below it, an RSA KeyPair generator is used instead of the full AES-compliant Android Keystone mechanism, since it was introduced on API 23. This generates two keys: that's not fantastic, but it should pretty much be ok for pre-M devices. I tested with physical devices and emulators but did not get a crash, maybe you can try to reproduce it on a real device using your same application to check if that's just something avd-related, or if we have to investigate a bit deeper? |
I think some coworkers have devices with older Android versions, I'll see if they've run into anything. I appreciate the prompt response 👍 |
I appreciate your detailed issue :) Thank you so much for helping out |
My config:
I've read through the other issues about using the AndroidKeyStore and how it works differently on API < 23. I'm assuming that the library handles all that internally - Am I misusing it?
The text was updated successfully, but these errors were encountered: