I am getting following error while generating certificates on my local machine.
You are watching: Keystore was tampered with, or password was incorrect
C:Usersabc>keytool -genkey -alias tomcat -keyalg RSAEnter keystore password:keytool error: java.io.IOException: Keystore was tampered with, or password was incorrectI think there is some problems in jdk version.I ran the same command on my collegues machine and it is working fine.
Please share your inputs.
This answer will be helpful for new Mac User (Works for Linux, Window 7 64 bit too).Empty Password worked in my mac . (paste the below line in terminal)
keytool -list -v -keystore ~/.android/debug.keystorewhen it prompt for
Enter keystore password: just press enter button (Dont type anything).It should work .
Please make sure its for default debug.keystore file , not for your project based keystore file (Password might change for this).
Works well for MacOS Sierra 10.10+ too.
I heard, it works for linux environment as well. i haven”t tested that in linux yet.
From your description I assume you are on windows machine and your home is abc
So Now : Cause
When you run this command
keytool -genkey -alias tomcat -keyalg RSA
because you are not specifying an explicit keystore it will try to generate (and in your case as you are getting exception so to update) keystore C:usersabc>.keystore and of course you need to provide old password for .keystore while I believe you are providing your version (a new one).
Either delete .keystore from C:usersabc> location and try the command
or try following command which will create a new xyzkeystore:
keytool -genkey -keystore xyzkeystore -alias tomcat -keyalg RSA
Note: -genkey is old now rather use -genkeypair althought both work equally.
I have deleted the existing keystore file and then followed the command keytool -genkey -alias key0-keyalg RSA, then it asks me new password and others data, I gave. But still now, when I try to build signed apk, it shows the same error message -“Keystore was tampered with, or password was incorrect ” What's the problem here?
In tomcat 8.5 pay attention to write the correct name of attributes. This is my code on server.xml:
You can visit https://tomcat.apache.org/tomcat-8.5-doc/config/http.html to see all attributes
Using changeit for the password is important too.
This command finally worked for me(with jetty):
keytool -genkey -keyalg RSA -alias selfsigned -keystore keystore.jks -storepass changeit -validity 360 -keysize 2048
Works on Windows
open command prompt (press Windows Key + R then type “cmd” without quotations in the appearing dialogue box and then press Enter Key).
then type the code sniff below :
cd C:Program FilesJavajdk1.7.0_25in
then type following command
keytool -list -keystore “C:/Documents and Settings/Your Name/.android/debug.keystore”
Then it will ask for Keystore password now. The default password is”android” type and enter or just hit enter “DONT TYPE ANY PASSWORD”.
Check your home folder ~/.gradle/gradle.properties. Sometimes if you have gradle.properties in home directory it takes details from the there. Either you can change that or delete the files. Then it will take required details from your local folder.
If you are working on signing your Flutter App by following this guide Build and release an Android app and run in to this error. I hope this answer helps you.
In my case I changed the path to store my key.jks. This happened to me because I there was an existing file in that path.
keytool -genkey -v -keystore ~/key.jks -keyalg RSA -keysize 2048 -validity 10000 -alias keyThis command stores the key.jks file in your home directory. To store it elsewhere, change the argument you pass to the -keystore parameter.
See more: Isaiah 55:9-11
In my case,
keytool -genkey -v -keystore /Users/Y/Desktop/X/key.jks -keyalg RSA -keysize 2048 -validity 10000 -alias keyYouri.e Y – Username and X – folder name
Then you will be prompted to Enter keystore password: and Re-enter new password:. Here you can use whatever password you want.
However, keep the keystore file private; don’t check it into public source control!