Signed Java Applet access denied java.io.FilePermission read -
i created java applet e-signature . applet runs normal , works while running on ide (intellij) . when deployed project .jar file , tried run on browser (firefox) got error saying .jar untrusted. made researches , signed applet jarsigner . follewed these steps :
keytool -genkey -keyalg rsa -alias mycert
keytool -certreq -alias mycert
- jarsigner c:\testapplet.jar mycert
also tried commands @ oracle web site .link here
after signed applet error gone , run applet. when try sign file got error saying applet dont have permision access cert store folder. error :
java.security.accesscontrolexception: access denied ("java.io.filepermission" "c:\users\chooseclick.sertifikadeposu" "read")
i found solution. able access files or other restricted action @ java , must use prilivaged blocks :
accesscontroller.doprivileged(new privilegedaction() { public object run() { //actions need permission goes here return null; } });
you can use block in function.
Comments
Post a Comment