I'm trying to deploy a Java applet on my website. I also need to sign it, because I need to access the clipboard. I've followed all the signing tutorials I could find but have not had any success. Here is what I've done so far:
keytool -genkey -keyalg rsa -alias myKeyName keytool -export -alias myKeyName -file myCertName.crt
jarsigner "C:\my path\myJar.jar" myKeyName
<html> <body> <applet code="my/path/name/myApplet.class" archive="../dist/myJar.jar"/> </body> </html>
When I open that html file, I never get the security confirmation dialog box (and thus get the "java.security.AccessControlException: access denied" error). This happens on all browsers.
Am I missing a step?
A Java applet can be executed from a Web browser. The class name must be the same as the file name that contains the class. A file may contain several classes. Each class in the file is compiled into a separate bytecode file.
3 easy steps
keytool -genkey -keystore myKeyStore -alias me
keytool -selfcert -keystore myKeyStore -alias me
jarsigner -keystore myKeyStore jarfile.jar me
Perhaps it's because you're opening some .class files outside the jar file?
That way it may not display the warning. I tried doing it that way but it still showed me the certificate warning and for a simple case it actually prevented me from accessing a class from the JAR with the separated class.
Maybe your specific setup or file organization causes that behavior. If you can layout that in more detail we could help better (or rather, try putting all those .class files in yet another signed Jar and add it to the archive"..., anotherJar.jar").
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With