I'm writing a java applet that uses org.apache.commons.net.ftp.FTP to upload a file to an ftp server from a webpage
the applet works in eclipse..
My project contains Uploader.java, FtpUpload_thread.java and the commons-net-2.2.jar (to import org.apache.commons.net.ftp.FTP) files..
I compile my classes using the cmd command:
javac *.java -cp *.jar
I put the class in html:
<applet code="Uploader.class" codebase="./" archive="commons-net-2.2.jar" width="600" height="230"></applet>
but when I try to establish the connection I get the error:
java.security.AccessControlException: access denied (java.net.SocketPermission /*myftp*/ resolve)
So I have to sign my applet..
I make my jar file:
jar cvf Uploader.jar Uploader.class FtpUpload_thread.class commons-net-2.2.jar
I generate keys:
keytool -genkey -alias signFiles -keystore compstore
and then I put the values that the program requires.. now I have the compstore database file
I Sign the JAR File
jarsigner -keystore compstore -storepass pass -keypass pass -signedjar UploaderS.jar Uploader.jar signFiles
and I have the UploaderS.jar file
so now I have my folder with:
Uploader.jar
UploaderS.jar
compstore
Uploader.class
commons-net-2.2.jar
FtpUpload_thread.class
it's all or I need other steps?
what is the html code to put my sign applet and run it with permissions?
thanks!