尝试刷新“过期"密钥库 [英] Trying to refresh 'expired' keystore
问题描述
我正在尝试使用 ant 任务signjar"对一些 jar 进行重新签名,但它告诉我签名者证书已过期."
I am trying to re-sign some jars using the ant task 'signjar' however it's telling me "The signer certificate has expired."
所以我尝试重新生成密钥库,希望这会使其不过期"...
So I tried to re-generate the keystore hoping this would 'un-expire' it...
keytool -genkey -keystore mykeystore -alias myalias
但在输入密钥库密码后,我得到:keytool 错误:java.lang.Exception:未生成密钥对,别名已存在"
but after entering the keystore password i get: "keytool error: java.lang.Exception: Key pair not generated, alias already exists"
我做错了什么?我需要删除密钥库来重新生成它还是有一种简单的方法可以刷新它以使其不会过期?
what am i doing wrong? do i need to delete the keystore to re-generate it or is there a simple way to refresh it so it's not expired?
谢谢.
推荐答案
您混淆了术语.密钥库包含密钥,密钥用于签名.
You're mixing up the terms. A keystore contains keys, a key is something used for signing.
AFAIK,您正在尝试使用现有别名(名称)将新密钥放入旧密钥库.你为什么不简单地使用一个新的?此或删除旧密钥从首先是密钥库.您不需要删除整个密钥库.
AFAIK, you're trying to put a new key into an old keystore using an existing alias (name). Why don't you simply used a new one? Either this or delete the old key from the keystore first. You don't need to drop the whole keystore.
看看 portecle,这个简单的工具可以让您更轻松地操作密钥库.
Have a look at portecle, this simple tool allows you to manipulate the keystore more easily.
这篇关于尝试刷新“过期"密钥库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!