Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sign java applet for work without java warnings

I have Vaadin application and my applet which integrated in it. When I start my web application every time i see this warning.

enter image description here

In turns when applet begins to start. After I push run and click button on web application to start applet turns new warning.

enter image description here

My boss told that it is ridiculous to show web app with that warnings. But i don't know how i have to sign my applet to turn off this warnings. Now i sign my applet with this instruction. It will be nice, if you will help me.

like image 945
user2911381 Avatar asked Sep 02 '26 14:09

user2911381


1 Answers

In order to get rid of this warning you're going to have to sign your applet.

By default an Applet is running inside a sandbox. This sandbox isolates the applet preventing malicious code from running without the user's granted permissions. Applets are considered untrusted if they are not signed with a security certificate. Unsigned applets are limited to execute only a set of "safe" operations. Unsafe applets cannot execute the following:

  • Accessing the local file system, executable files, system clipboard, and printers on client’s computer.
  • Connecting to any server other than the server where they are hosted.
  • Loading native libraries.
  • Altering the SecurityManager.
  • Creating a ClassLoader.
  • Reading some of system properties.

In order to sign your applet you'll need to purchase an RSA certificate from a trusted source. You can purchase for RSA certificates from a Certificate Authority (CA), such as VeriSign and Thawte. To obtain a certificate from a CA, you need to provide the certificate signing request (CSR). The steps are as follow:

  • Use keytool to generate an RSA keypair.
  • Use keytool to generate the certification signing request, then submit the CSR to the CA.
  • The CA will send you a certificate reply (chain) by email.
  • Import the chain into your keystore.
  • Use jarsigner to sign applet’s JAR file.

Once you have everything all you need to do is sign the JAR with your certificate and you should be good to go. To sign the JAR just do the following:

jarsigner -keystore <keystore_name> -storepass <store_pass> -keypass <key_pass> -signedjar <signed_jar_file_path> <original_jar_file_path> <alias_name>
like image 199
kungfuice Avatar answered Sep 05 '26 05:09

kungfuice