Java – attempt to refresh the ‘expired’ keystore
I'm trying to re sign some jars using the ant task 'signjar', but it tells me that "the signer's certificate has expired."
So I tried to regenerate the keystore, hoping it would "Disarm" it
keytool -genkey -keystore mykeystore -alias myalias
But after entering the keystore password, I get: "keytool error: Java. Lang. exception: the key pair is not generated, and the alias already exists"
What on earth did I do wrong? Do I need to delete the keystore to regenerate it? Or is there a simple way to refresh it so that it doesn't expire?
thank you.
Solution
You confused the terms The keystore contains the key, which is the key used for signing
AFAIK, you try to put the new key into the old keystore using an existing alias (name) Why don't you just use a new one? Either this or delete the old key from the keystore You do not need to delete the entire keystore
Look at portecle, a simple tool that makes it easier for you to operate the keystore