登录蚂蚁一launch4j可执行sign4j和jsign [英] Sign a launch4j executable in ant with sign4j and jsign

查看:452
本文介绍了登录蚂蚁一launch4j可执行sign4j和jsign的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在一个罐子里的应用程序,我将它包装在一个exe与launch4j所以很容易为用户启动它(在Windows)。我有一个证书,所以我签罐子(我不知道这是不是真的有必要,因为它的EXE里面包裹),我要签名的exe文件,但它破坏可执行文件。

I have an application in a Jar and I wrap it in a exe with launch4j so is easy for the user to launch it (in windows). I have a certificate, so I sign the jar (I don't know if this is really necessary because it will be wrapped inside the exe) and I want to sign the exe but it corrupt the executable.

我用蚂蚁做所有的进程,并期待这样的:

I use ant to make all the process and look like:

<signjar jar="${jar.location}" alias="${key.alias}" storetype="pkcs12" keystore="${key.file}" storepass="${key.password}" tsaurl="https://timestamp.geotrust.com/tsa" />

<launch4j configFile="launch4j_configuration.xml" fileversion="${version}.0" txtfileversion="${build}" productversion="${version}.0" txtproductversion="${build}" outfile="${exe.location}" jar="${jar.location}" />

<signexe file="${exe.location}" alias="${key.alias}" storetype="pkcs12" keystore="${key.file}" storepass="${key.password}" tsaurl="http://timestamp.verisign.com/scripts/timstamp.dll" />

我发现,是因为当你签署的exe它打破了罐子结构或类似这样的东西。但我也看到的是,里面的launch4j文件夹是文件夹sign4j包含什么,我认为是解决这一问题的方案。

I have found that is because when you sign the exe it broke the jar structure or something like this. But what I have also seen is that inside the launch4j folder is a sign4j folder that contains what I think is a program that solve this problem.

我现在的问题是如何使用这个程序?而且我怎样才能将它集成在ant脚本签署exe文件?

My problem now is how is used this program? And how can I integrate it in the ant script to sign the exe?

文件夹中的readme.txt文件不帮我。很抱歉,如果这如此明显,但目前尚不清楚对我来说。另外请注意,我使用Ubuntu。

The README.txt file in the folder doesn't helped to me. Sorry if this so obvious but isn't clear for me. Also note that I'm using Ubuntu.

推荐答案

我发现的是,你必须签署命令,它的参数执行sign4j命令。是这样的:

What I have found is that you must execute the sign4j command with the signing command as its argument. Something like:

sign4j jsign -s keyfile.p12 -a "(codesign_1091_es_sw_kpsc)" --storepass AVERYGOODPASSWORD --storetype pkcs12 -n MyProgram -u https://www.example.com MyProgram.exe

因此​​,将其整合到蚂蚁,你需要创建一个 EXEC 任务。例如,是这样的:

So, to integrate it into ant, you need to create an exec task. For example, something like:

<exec executable="sign4j">
  <arg line="java -jar jsign-1.2.jar -s ${key.file} -a ${key.alias} --storepass ${key.password} --storetype pkcs12 ${exe.location}"/>
</exec>

它的工作原理也与其他签约工具,如微软例如authenti code,太...

It works also with other signing tools like for example authenticode from Microsoft, too ...

<exec executable="launch4j/sign4j/sign4j.exe">
    <arg line="signtool.exe sign /fd SHA256 /f mycert.pfx /p foobar /t http://timestamp.verisign.com/scripts/timstamp.dll dist\myapp.exe"/>
</exec>

这篇关于登录蚂蚁一launch4j可执行sign4j和jsign的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆