问题标签 [jar-signing]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
3 回答
1884 浏览

java - 签署一个 Jar 文件

我在 jar 中手动添加了一些类文件。并在服务器中替换。但是服务器没有拿出这个新的jar说:java.lang.SecurityException:类“test.TestProcess2”的签名者信息与同一包中其他类的签名者信息不匹配。

我是否需要在更新后对 jar 进行签名以及如何做。

提前致谢

0 投票
1 回答
414 浏览

java - Java Webstart (Library) signing

I am a bit concerned about our current build process. It smells of 'the wrong way' and causes our clients a lot of additional downloads.

We have a regular Java project that we publish through Webstart. It uses a variety of libraries that we supply as .jar files. Our JNLP looks like this:

So far so good. Now there is a problem with using jars signed by different certificates, I guess, or maybe that's only if one is singed with a self signed certificate. Either way, the solution found was that all jars have to be signed by the same certificate.

Subsequently, we copy all our jars, our own as well as the libraries, into the Webstart folder and sign them like so with Ant:

This all works fine, although it takes a long time signing every jar. But it also causes every client to redownload every library jar every time we publish a change to our own application jar (which is a lot). The libraries don't technically change, but the resigning makes them appear new.

Are we doing this right ? Is there a better way ? Can we somehow change our build process to make it so people can cache the library jars ?

0 投票
1 回答
2900 浏览

java - Signing jar with timestamp and authentication at the timestamp server

I want to use the timestamp option -tsa of the java jarsigner tool. The timestamp service I have in mind requires authentication. For this purpose you get a personalized soft token to identify yourself at the timestamp server.

My question: Is this authentication supported by the jarsigner tool? In other words: does jarsigner support RFC 3161 (Time-Stamp Protocol) and RFC 2246 (Authentication)?

There is an option -tsacert of the jarsigner. The documentation states:

If "-tsacert alias" appears on the command line when signing a JAR file then a timestamp is generated for the signature. The alias identifies the TSA's public key certificate in the keystore that is currently in effect. The entry's certificate is examined for a Subject Information Access extension that contains a URL identifying the location of the TSA.

What I am confused by is the wording "a timestamp is generated for the signature". What does this mean? Also the wording "the alias identifies the TSA's public key certificate" is confusing: it seems that it is used to verify the timestamp (because it's a public key) not to identify the requester (because it is not a private key).

Moreover: The certificate with which I want to sign is not a soft token but is stored on a smart card. It can not be exported to a keystore. Therefore I have to use the options -keystore NONE -storetype PKCS11. I think that for this reason the option -tsacert alias can't be used because it needs a real keystore which contains the soft token.

0 投票
1 回答
3831 浏览

android - 签署 Android 应用程序时出现“文件名、目录名或卷标语法不正确”

当我在发布模式下编译我的 Android 应用程序并尝试对其进行签名时,我收到以下错误:

文件名、目录名或卷标语法不正确

我设置key.storeant.properties我的密钥库文件的相对路径。文件名或路径中没有空格。我确定我为密钥库使用了正确的密码,因为我可以使用该keytool -list命令来查看它。还有什么可能导致此错误?

更新:

当我使用绝对路径时,我收到以下错误消息:

“密钥库”的值无效。它必须解析为单一路径

0 投票
3 回答
448 浏览

java - 签名小程序加载签名jar读取文件错误

我目前正在开发一款游戏,并制作了一个 JFrame 加载器,它可以从 user.home 目录加载游戏,但最近决定我也想在 web 小程序中使用它。

当我运行 JFrame 加载程序时,它成功加载游戏,检查文件并打开。(游戏和 JFrame 都已签名)我可以使用以下方法从 Applet 加载和调用该方法:

但是当Applet尝试加载它时会发生以下错误,它可以正常加载游戏,但是当它尝试使用代码加载保存的选项时:

它给了我以下错误:

2013 年 3 月 14 日晚上 11:10:21 core.GameEngine 运行严重:null java.security.AccessControlException:访问被拒绝(“java.io.FilePermission”“C:\Users\Jake.Zombies\Options.keys”“读取” ) 在 java.security.AccessControlContext.checkPermission(Unknown Source) 在 java.security.AccessController.checkPermission(Unknown Source) 在 java.lang.SecurityManager.checkPermission(Unknown Source) 在 java.lang.SecurityManager.checkRead(Unknown Source) 在java.io.File.exists(Unknown Source) 在 core.Configuration.loadKeys(Configuration.java:123) 在 core.Configuration.onStartup(Configuration.java:105) 在 core.GameEngine.run(GameEngine.java:76)

如果行 if(!f.exists()) 是 Configuration.java:123

我的问题是它在 JFrame 加载器(已签名)中加载良好,但在 Applet(已签名)中加载良好

非常感谢任何帮助,谢谢。

编辑:小程序加载程序检查文件,并且可以下载最新的文件。只有当我询问我加载的游戏时,才能加载它遇到问题的文件。

编辑2(完整加载代码):

通过仅获取缓冲输入流,然后将其写入缓冲输出流来写入。

0 投票
1 回答
563 浏览

javafx - 在启动画面期间加载罐子

我有一个引用 4-5 个外部 jar 文件的主应用程序。因此,在编译项目 netbeans ide(javafx application) 时需要很长时间。因此,我想设计一个启动画面,它会一直显示到所有 jar 都加载完毕。

我的 JNLP 文件是

0 投票
0 回答
789 浏览

java - 如何创建默认 .keystore 文件或恢复 .keystore

当我尝试跑步时

我得到跟随错误。

我怀疑这可能会导致问题。

如何生成 .keystore 文件。我不太喜欢 JAVA,所以这可能是一个简单的问题。

0 投票
1 回答
9049 浏览

java - Java Applet - “阻止运行可能不安全的组件?” 信息

jar自最新的 Java 更新以来,即使我们使用的两个文件都已签名,我的两个小程序仍向我们的用户显示警告弹出窗口。我已经验证它们是使用jarsigner -verify MyJarFile.jar命令签名的。下面是我们看到的弹出消息...

在此处输入图像描述

我的小程序通过 JNI 调用 C++ dll。C++ dll 调用 C# 网络模块。

有谁知道我能做些什么来让这个弹出窗口消失?它说应用程序包含签名和未签名的代码,但我正在签署我的 jar 文件中的每个 java 文件(只有 1 个)。我需要做更高级别的签名吗?

编辑:这发生在最新的 Java 更新中。请参阅以下引自此页面的引文。

使用 Java 小程序或 Java Web Start 技术(在运行时通过 Web 浏览器或网络分发给最终用户的应用程序)的作者和供应商应使用受信任的证书对其代码进行签名,以获得最佳用户体验。具体来说,在客户端浏览器中执行的所有 Java 代码都会提示用户。显示的对话框消息的类型取决于风险因素,如代码签名或未签名、请求提升权限的代码、JRE 高于或低于安全基线等。低风险场景显示一个非常小的对话框,并包含一个不显示类似对话框的复选框将来由同一供应商提供。考虑到风险增加,更高风险的场景(例如运行未签名的 jar)将需要更多的用户交互。

0 投票
1 回答
2296 浏览

java - 具有有效 CA 的签名小程序仍显示为未知发布者

好吧,我尝试阅读几乎所有文章,但我没有找到任何提示。

从 StartSSL 收到我的官方证书后,我仍然无法在没有 UNKNOWN 发布者警告的情况下启动我的小程序。

我用了

我检查过

看起来一切都很好:

那么为什么发布者仍然显示为未知?我错过了什么?另一个证书还是与 Java 7(已安装)或 Safari(10.8)有关?还是因为浏览器没有将 StartCom 识别为有效的 CA?

附加信息:我检查了 java 控制台并得到以下信息:

这是 StartCom 的目标代码签名证书。我之前明确导入了 StartCom 证书以确保找到这些证书,但仍然没有成功。

0 投票
3 回答
2163 浏览

android - After Adding quickblox-android-0.8.1.jar file in project libs folder and getting error when install on device

when add quickblox-android-0.8.1.jar in My Project libs folder then I'm getting an error. I have done all related for it like update Adt to 21, bin delete and clean, restart Eclipse etc but not working. Also in my project 13 jar files contains. here Only quickblox-android-0.8.1.jar is getting issue.dependency issue and Multiple dex files issue.pls help me. facing issue from last 4 days

below jar files using in Project libs folder contains

error log

In simple when i'm adding this jar file then project not working and when Remove this jar file from Project then load (run) project well and able to install on device and Emulator, this may simple issue but coudnot resolve it.

java Buildenter image description here

Java Order - and Exportenter image description here

Error Image enter image description here