Questions tagged [android-keystore]

The Android system requires that all installed applications be digitally signed with a certificate whose private key is held by the application's developer. "Android keystore" may also refer to Android Keystore System, introduced in API level 18, which allows storing cryptographic keys securely within an app.

Android requires that all apps be digitally signed with a certificate before they can be installed. Android uses this certificate to identify the author of an app, and the certificate does not need to be signed by a certificate authority. Android apps often use self-signed certificates. The app developer holds the certificate's private key.

"Android keystore" may also refer to Android Keystore System, introduced in API level 18, which allows storing cryptographic keys securely within an app.

Useful links

882 questions
13
votes
4 answers

Android: Error - App has same packaged different signature

I am getting an issue where android studio is saying Installation failed since the device has an application with the same package but a different signature. . . .. This is correct, as I recently signed an APK and uploaded to the beta area of my…
Martin
  • 22,234
  • 53
  • 190
  • 309
12
votes
1 answer

KeyGeneration using AndroidX.Biometric fails if only face as biometric is installed

we are currently trying to sign data with biometrics, which we use the androidx.biometric library for. The Problem is, if no Fingerprint ist installed but a face registered we cannot generate any keys. With Fingerprint only or with the combination…
12
votes
6 answers

Published App on Play Store can't communicate with Google Maps API and Facebook API

I created a signed APK with Android Studio, and I added to Google Developer console and Facebook console my SHA1 fingerprint and the relative api keys in my app. Everything works well if I upload my signed apk via USB, after installing it maps API…
12
votes
3 answers

Storing credentials in the Android app

How can we safely storing credentials data for access to the smtp-server in Android app? These data are constants and only the developer should know them. At the moment they are stored in the code, but this is not safe, because they can be seen by…
12
votes
6 answers

What is the location of the keystore file in Android Studio?

I just recently found out the importance of backing up the keystore file in Android Studio. I have two apps published using this computer. Both times I simply used "Generate APK" in Android Studio Build drop down. I would really appreciate some…
Rehan Yousaf
  • 665
  • 2
  • 7
  • 14
12
votes
1 answer

Use KeyPairGeneratorSpec for Android API level < 18?

I want to store secret data in the private keystore of my app. However, as I was working on the code to do this, Android Studio warned that KeyPairGeneratorSpec.Builder(context) requires API level 18 and I'm targeting 14 as a minimum. :-( How can I…
Someone Somewhere
  • 22,369
  • 11
  • 111
  • 155
11
votes
2 answers

Android: Store SecretKey in KeyStore

I use a SecretKey to encrypt sensitive data in my application. Currently I am storing my SecretKey in Base64 encoded format in DB or SharedPrefs which is not a safe place to store Secret on a rooted phone. Hence, I want to move my SecretKey to…
Rajkiran
  • 14,425
  • 24
  • 69
  • 108
11
votes
4 answers

Keystore file D\Telegram-master\TMessagesProj\config\release.keystore not found for signing config 'debug'

I downloaded new version of Telegram. When run it,This error has shown: Keystore file D\Telegram-master\TMessagesProj\config\release.keystore not found for signing config 'debug'. How fix it?
AndroidDev
  • 611
  • 1
  • 9
  • 20
10
votes
0 answers

javax.crypto.BadPaddingException: error:1e000065:Cipher functions:OPENSSL_internal:BAD_DECRYPT

I'm storing AES decryption key in AndroidKeyStore to decrypt data from SQLiteDB. Unfortunately, sometimes I get this error (Any android device and any API) rarely. I would like to know what exactly this error means. javax.crypto.BadPaddingException:…
10
votes
2 answers

Android Key Store API 23, use setUserAuthenticationRequired without Fingerprint Scanner

I've tried to generate a key pair using the Google sample (BasicAndroidKeyStore). The only modification I made is setting the setUserAuthenticationRequired(true) in the KeyGenParameterSpec.Builder. I assume it would work fine on a device with the…
10
votes
2 answers

Multiple signingConfigs for multiple variants

How can I set different signing configs for different variants? For instance, we currently have the buildtypes Debug/Beta/Release with 2 flavors, free and paid, resulting in 6 variants. To make it a bit easier, let's forget the Debug variants and…
Aegis
  • 5,573
  • 2
  • 29
  • 41
10
votes
0 answers

Where can I find the private keystore file generated by the Android Studio "Generate Signed APK Wizard"?

I have used Android Studio's "Build" -> "Generate Signed APK..." -> "Generate Signed APK Wizard" to create a new keystore and sign an app that I want to publish to the Play Store. The problem I am having is I can't seem to locate the .keystore file…
user855336
  • 101
  • 1
  • 1
  • 4
9
votes
2 answers

Android Central Keystore

I'm hoping that there's a way to programmatically access a central trusted keystore on an Android device. I know one exists, at least for verifying SSL connections etc. which also comes with a handy tool for adding certificates, browsing, etc. …
Nick
  • 7,855
  • 2
  • 36
  • 62
9
votes
1 answer

Cannot update release APK using Google Play app signing upload certificate (with original keystore)

I was trying to update a release on Google Play. Upon uploading my signed APK, I received this error message in the Google Play Console: You uploaded an APK that is not signed with the upload certificate. You must use the same certificate. The…
9
votes
0 answers

Android KeyStore: While the device is locked, can background processes still access keys?

Basically whats going on is I want to encrypt/decrypt some session tokens (just a string) before/after storing them. However I've read that the Android KeyStore is locked and unaccessible while the device is locked, but I still need to be able to…