简体   繁体   English

您如何将Java小程序从IDE获取到网站上?

[英]How do you get a Java applet from the IDE onto a website?

I have done quite a bit of searching around for a solution to this problem and the more I look into this the more complex the problem gets. 我已经做了大量的工作来寻找该问题的解决方案,而我对这个问题的研究越多,问题就越复杂。 I'm convinced I'm missing something, it can't be this difficult to get an already existing Java applet onto a website. 我确信我缺少了一些东西,将一个已经存在的Java小程序发布到网站上并不难。

I have currently created a simple Applet, compiled it into a .jar file and included the simple HTML markup for it. 我目前已经创建了一个简单的Applet,将其编译为.jar文件,并包括了简单的HTML标记。

<html>
<body>

<applet code=myApplet.class
        archive="myApplet.jar"
        width=400 height=700>
</applet>

</body>
</html>

This begins to load, which implies that it's working, but then I get warnings and security errors that absolutely will not allow the applet to play. 这开始加载,这意味着它正在工作,但是随后我收到警告和安全错误,这些错误和绝对不会允许该applet播放。

Further research suggests that the applet must be signed first, this is where I am struggling. 进一步的研究表明,必须首先签署applet,这是我在努力的地方。

Questions 问题

  • How is signing an applet making it any safer? 签署applet如何使它更安全? If I am able to sign this applet and make it usable, how is signing a malicious program any harder than signing a game? 如果我能够签署此applet并使之可用,那么签署恶意程序要比签署游戏难吗?
  • Where can I find a copy of "signtool" (apparently required to sign applets)? 在哪里可以找到“ signtool”的副本(签署小程序显然是必需的)? How do you use it? 你如何使用它?
  • What is an RSA certificate and how do I obtain one? 什么是RSA证书,如何获得它?
  • What is a keystore? 什么是密钥库?

I'm, basically looking for an existing step-by-step process to get through making a VERY basic applet, and posting it online so that it is viewable to anybody. 我基本上是在寻找现有的分步过程来制作一个非常基本的小程序,并将其发布到网上以便任何人都可以看到。

The security process is daunting and confusing and I'm not entirely certain how to sign an application. 安全过程令人生畏且令人困惑,我不确定如何对应用程序进行签名。

Oracle's explanation mentions that the processes requires "signtool" and links to a site that doesn't mention it and I can't find it. Oracle的解释提到该过程需要“ signtool”,并链接到未提及它的站点,而我找不到它。 Furthermore, I'm not entirely certain this is even necessary. 此外,我不确定这是否是必要的。

  1. The signature provides the user with information about who the source of the JAR is and confidence that it hasn't been tampered with. 签名为用户提供了有关谁是JAR的来源以及未受到篡改的信心的信息。 That being said, a self-signed JAR is not really any more secure than an unsigned JAR. 话虽这么说,但自签名的JAR确实比未签名的JAR更安全。

  2. You can find jarsigner in the bin directory of your JDK. 您可以在JDK的bin目录中找到jarsigner。

  3. That's a pretty broad question and more applicable to the security site than stackoverflow. 这是一个相当广泛的问题,比stackoverflow更适用于安全站点。 Try searching on https://security.stackexchange.com/ 尝试在https://security.stackexchange.com/上搜索

  4. It's a file that contains public keys, private keys, and certificate chains. 它是一个包含公用密钥,专用密钥和证书链的文件。 Keystores are the standard Java method for managing your certificates. 密钥库是用于管理证书的标准Java方法。 For a more in-depth answer, see wikipedia. 有关更深入的答案,请参阅Wikipedia。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM