Java Applet - "Block potentially unsafe components from being run?"消息

标签 java applet jarsigner jar-signing

<分区>

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

enter image description here

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

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

编辑:这是在最新的 Java 更新时发生的。请参阅以下摘自 this page 的引述.

Authors and vendors of applications deployed using either Java applets or Java Web Start technology – applications distributed to end users at runtime via the web browser or network - should sign their code using a trusted certificate for the best user experience. Specifically, all Java code executed within the client’s browser will prompt the user. The type of dialog messages presented depends upon risk factors like, code signed or unsigned, code requesting elevate privileges, JRE is above or below the security baseline, etc. Low risk scenarios present a very minimal dialog and include a checkbox to not display similar dialogs by the same vendor in the future. Higher risk scenarios, such as running unsigned jars, will require more user interaction given the increased risk.

最佳答案

我想出了答案。我的 eclipse 项目中没有 list 文件,所以我创建了一个名为 manifest.mf 的文件,并将以下代码放入其中。

Manifest-Version: 1.0
Trusted-Library: true

在 eclipse 中构建 jar 文件时,在第 3 页,它要求您提供 list 文件。我相信它默认此选项为“为我创建 list 文件”,但此 list 文件仅包含上面的第一行。选择“使用工作区中的现有 list ”选项,然后选择您刚刚创建的 manifest.mf 文件。然后像往常一样在您的 jar 上签名。

解决问题的是 Trusted-Library 属性。查看this page有关此属性和其他特权代码 jar 文件的更多信息。

关于Java Applet - "Block potentially unsafe components from being run?"消息,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16441436/

相关文章:

java - 如何将 JavaScript 变量发送到 Java 小程序

java - InstanceOf 关键字在 Java 小程序中不起作用

jarsigner - 如何通过命令行传递jarsigner.exe密码?

android - 如何在 Android 手机上签署 ".apk"文件?

java - 用于在 Java 中实现 Web 套接字的任何 API

java - 我无法在 Mysql 数据库中存储 .doc 简历

java - MyFaces - 抽象类上的 @PostConstruct

java - 按钮未从循环中出现

android - 如何使用我用 GPG 制作的私钥签署 apk?

java - 使用静态工厂方法创建的对象的模拟行为