我们可以在java中签署已签名的罐子吗? [英] can we resign the already signed jars in java?
本文介绍了我们可以在java中签署已签名的罐子吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个带有旧签名的 .jar
文件,并希望使用新签名重新签名。可能吗?
I've a .jar
file with an old signature and want to resign it with a new signature. Is it possible?
如果可能:怎么做?
推荐答案
如果签名不是您拥有的签名,则需要首先解开jar。
If the signature is not one you own, you would need to unjar the jar first.
像这样(假设是unix,否则翻译为dos):
Like so (assume unix, translate to dos otherwise):
jar xvf JarName.jar
rm -rf META-INF
jar cvf JarName.jar *
现在你需要运行jarsigner来签署jar
Now you need to run jarsigner to sign the jar
jarsigner -keystore /yourkeystoredirectory/mystore -storepass yourpass
-keypass yourkeypasswd JarName.jar keyname
如果你不喜欢没有密钥库,你可以使用keytool创建一个。
If you don't have a keystore, you can create one with keytool.
这篇关于我们可以在java中签署已签名的罐子吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文