Please Help java.policy signedBy can't access file local

i create keystore and signjar in web applet
run tomcat access file in local but not acess file denied
i goto edit file java.policy
grant {
     permission java.security.AllPermission;
can access file
but put SignedBy cannot access file
grant SignedBy fuangchai{
     permission java.security.AllPermission;
Please help me example file keystore,applet.jar,java.policy
to signedby access file local in webapplet
env JDE 1.5 ,javascript yui 2.8 ,prototype js,tomcat6
File html
<object classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"
codebase="http://java.sun.com/update/1.5.0/jinstall-1_5-windows-i586.cab#Version=5,0,0,5"
width="1" height="1" >
<param name=code value="com.arg.aes.test.FileDirectoryBS.class" >
<param name=archive value="app.jar">
<param name=codebase value="." >
<param name="type" value="application/x-java-applet;version=1.5">
<param name="scriptable" value="true">
<param name="mayscript" value="true">
<param name="debug" value="false">
<comment>
<embed name="myApplet" id="myApplet"
type="application/x-java-applet;version=1.5"
code="com.arg.aes.test.FileDirectoryBS.class"
archive="app.jar"
java_codebase="."
width="1"
height="1"
scriptable="true"
mayscript="true"
pluginspage="http://java.sun.com/products/plugin/index.html#download">
<noembed>
</noembed>
</embed>
</comment>
</object>
<applet
code="com.arg.aes.test.FileDirectoryBS"
width="1"
height="1"
archive="app.jar"
name="myApplet"
codebase="."
MAYSCRIPT="true"
>
</applet>
javascript
initlistfile : function() {
          try
               var list = $("myApplet").initlistfileInDir();     
               var jsondata = list.evalJSON();
               /*alert(jsondata.dirname);
               alert(jsondata.dirpath);
               alert(jsondata.listfile.length);*/
               initTableLeft(jsondata.listfile);
          catch(e)
               alert("Exception : access denied.");
               return;
import java.applet.Applet;
import java.io.File;
import java.security.Permission;
import java.security.PermissionCollection;
import java.security.Policy;
import java.security.ProtectionDomain;
import java.text.DecimalFormat;
import java.text.NumberFormat;
import java.util.ArrayList;
import java.util.Enumeration;
import java.util.List;
* @author fuangchai
public class FileDirectoryBS extends Applet{
public static File[] ROOTS = File.listRoots();
public static String HOME = System.getProperty("user.home");
public String listDir()
return JsonObj.makeTopDir((ROOTS.length > 0)?ROOTS : new Object[]{HOME});
public String initlistfileInDir()
return listfileInDir(null);
public String listfileInDir(String dirName)
if(null == dirName || dirName.equals(""))
System.out.println("root = " + ROOTS.length);
try {
dirName = (ROOTS.length > 0)?ROOTS[0].getPath():HOME;
catch (Exception e) {
e.printStackTrace();
return "";
System.out.println("#########################");
DirectoryDescImp obj = makeObjDir(dirName);
return (null == obj)?null:JsonObj.makeDir(obj);
public String listlinkInDir(String dirName)
if(null == dirName || dirName.equals(""))
System.out.println("root = " + ROOTS.length);
try {
dirName = (ROOTS.length > 0)?ROOTS[0].getPath():HOME;
catch (Exception e) {
e.printStackTrace();
return "";
System.out.println("#listlinkInDir#");
try {
File obj = new File(dirName);
return (null == obj)?null:JsonObj.makelinkDir(obj.getName(),obj.getPath());
} catch (Exception e) {
System.out.println("I can't access a file here! Access Denied!");
e.printStackTrace();
return null;
public boolean isEnc(File f)
//TODO
return false;
public DirectoryDescImp makeObjDir(String dirName)
System.out.println("dirName = " + dirName);
try{
File dir = new File(dirName);
String[] entries = dir.list();
if(null == dir || null == entries || entries.length <= 0)
System.out.println("Data is null or not obj." );
return null;
System.out.println("Dir List = " + dir.list().length);
System.out.println("Dir Name = " + dir.getName());
System.out.println("Dir Path = " + dir.getPath());
DirectoryDescImp dirDesc = new DirectoryDescImp();
dirDesc.setDirName(dir.getName());
dirDesc.setDirPath(dir.getPath());
List<FileDescImp> list = new ArrayList<FileDescImp>();
for(int i=0; i < entries.length; i++) {
File f = new File(dir, entries);
FileDescImp fDesc = new FileDescImp();
fDesc.setFile(f);
fDesc.setFileEncrept(isEnc(f));
list.add(fDesc);
dirDesc.setListfile(list);
return dirDesc;
catch(Exception e){
System.out.println("I can't access a file here! Access Denied!");
e.printStackTrace();
return null;
Thank you
Fuangchai Jum
Mail [email protected]
Edited by: prositron on Jan 13, 2010 7:35 AM

OK,
Let's say I have to intialize Environment, and call method initEnvironment() in Applet's init(). Environment class:
class Environment
     private KeyStore keyStore;
     private Enumeration<String> aliases;
     public void initEnvironment() {
          Security.addProvider(new sun.security.mscapi.SunMSCAPI());
          keyStore = KeyStore.getInstance("Windows-MY");
          keyStore.load(null);
          aliases = keyStore.aliases();
}Applet is signed, I trust signer.
Since Applet is signed I'm able to overwrite existing .java.policy under user.home.
This doesn't work if I don't have .java.policy:
grant {
  permission java.security.SecurityPermission "insertProvider.SunMSCAPI";
  permission java.security.SecurityPermission "authProvider.SunMSCAPI";
  permission java.util.PropertyPermission "jsr105Provider", "read";
  permission java.util.PropertyPermission "com.sun.xml.internal.ws.api.pipe.Fiber.serialize", "read";
  permission java.lang.RuntimePermission "setContextClassLoader";
  permission java.util.PropertyPermission "com.sun.xml.internal.ws.api.streaming.XMLStreamWriterFactory.noPool", "read";
  permission java.lang.RuntimePermission "accessDeclaredMembers";
  permission java.lang.reflect.ReflectPermission "suppressAccessChecks";
  permission java.lang.RuntimePermission "accessClassInPackage.com.sun.xml.internal.ws.fault";
  permission java.util.PropertyPermission "com.sun.xml.internal.ws.api.streaming.XMLStreamWriterFactory.woodstox", "read";
};P.S.
Does it make sense to be able to make changes to file system and not be able to make actions from above policy?!?!

Similar Messages

  • Please help!!! Can't access my photos

    I migrated everthing from my Powerbook G4 to a powerMacg4. My iPhoto library has nothing in it. So I downloaded my iLife05 disc, then was able to access my photos from Preview. I tried importing them to the iPhotolibrary. Now I can't open them ANYWHERE. I'm freakin out here! Please, anyone? Heeeeelp me!!!!!

    Remember we can not see your computer nor are we mind readers - we need more details than it does not work
    I migrated everthing from my Powerbook G4 to a powerMacg4.
    Exactly how did you do this?
    My iPhoto library has nothing in it.
    Are you seeing this in the finder, in iPhoto, how?
    So I downloaded my iLife05 disc, then was able to access my photos from Preview. I
    Any more information here? your photos are totally separate form the iPhoto program on the iLife 5 disk and installing/reinstalling iPhoto does not in any way affect what Preview can see.
    tried importing them to the iPhoto library.
    Where are they? How did you try to import them? what happened?
    Now I can't open them ANYWHERE.
    Again - tell us as much as you can about what you have done and what you are seeing now and we will try to assist
    LN

  • Please help restore DMG missing partition and access file vault.

    I am quite emotional at the moment, if anyone can help me access my files, pictures of my baby daughter and important documents.. I would be extremely grateful and willing do make a donation via paypal.
    I have a 160 GB hard drive, which was partitioned as 30GB Spare and 130GB with my operating system and user files, including my filevault user directory.
    My computer was downloading movies which filled up the 130GB partition, most of the 130GB is contained in my personal filevault user directory, my computer became very slow and unresponsive and i tried to free up space by deleting files which i no longer needed.
    The machine became slow and un-responsive and required a number of forceful shut downs and restarts until the machine would no longer boot up, I inserted the OSX CD and attempted to boot from CD and use disc utility which now only displays my 30GB storage space, I was forced to install OSX on the remaining 30GB partition.
    Now running OSX on the 30GB partition i used DISK DRILL to scan my hard disk for the missing 130GB partition which it did and i was able to save this as a DMG file to a external hard disk, now i am able to get this DMG to mount in the OSX i am running on the spare 30GB space, however i am not able to access the majority of the data inside the file vaulted user account.
    I would like to know, would it be possible to restore the missing partition, as it remains on the HD but seems to be hidden.
    Or is there somehow i can login to the user account on the mounted DMG ?
    I am not very familiar with using terminal and would be extremely grateful for any advice or support leading to the recovery of my files.

    plesehelpme wrote:
    Is there anyway to recover the larger partition ? In disk utility i made the mistake of pressing the - button which has left me with the following: 
    [NO NAME] - is currently where i have installed OSX temporarily.
    And the grey space which contains my previous operating system and all my information which i desperately need to retrieve.
    Is there anyway to restore and boot the missing partition ?
    Probably not.     You've now deleted the partition.  It was probably useless anyway, though.
    When i run disk drill or other disk recovery tools i am able to see the partition including including the files and my personal sparsebundle.
    But you can't open the sparse bundle, much less see any of the files inside it, right?
    Since you've already recovered the (probably-damaged) sparse bundle containing your encrypted home folder, you'll have to work with it.
    I'd strongly recommend making another copy of that on another external HD and putting that "on the shelf" before doing anything else to it.   I suspect you have little chance of recovery, but don't take the risk of further damage.  
    You haven't answered my earlier questions:
    Have you tried to run Repair Disk on either the original or copied partition?
    If that doesn't help, this might:  http://www.thexlab.com/faqs/fixfilevault.html
    Do you have Time Machine backups?
    Obviously, now that the partition has been deleted, you can't run repair disk on it, but try it on the recovered disk image.  
    You need more expertise than either Christopher or I have.  Since Apple no longer uses "legacy" File Vault, it will be more difficult for them to help, too.
    Is your Mac covered by AppleCare?  If so, give them a call. 
    If not, your nearest Apple Store Genius Bar might be able to help:  http://www.apple.com/retail/geniusbar/ 
    Or check for an Apple Authorized Service Provider: http://support.apple.com/kb/HT1434?viewlocale=en_US
    If not, one of them may know of an outside service than can help.  That will be quite expensive.

  • HT4972 I have ipad 1 . And i want to update it from ios 4.3.5 to ios 7 but i can't why ?? Please help me becouse i can't download apps from app store !!!!!   I would suggust:  1 to create a big camera for i pads and ipods and iphones so we can put it in a

    I have ipad 1 . And i want to update it from ios 4.3.5 to ios 7 but i can't why ?? Please help me becouse i can't download apps from app store !!!!!
    I would suggust:
    1 to create a big camera for i pads and ipods and iphones so we can put it in another ipad or ipod or iphone and it has a zoom lens
    2 when i downloaded photos and music from a computer to my ipad , i cant delete them now plese do the itunes like samsung becuz samsung have an easier way to download thing from computer
    I hope to help me with my poblome and fix it please !!??
    And i hope to take my suggusts and make me happy becouse apple it is cooler from samsung
    Apple the best
    H.M

    The iPad 1 can't run the newer operating systems. It'd be like trying to play a bluray disc in your 6 year old dvd player....it simply lacks the hardware to make the software run.
    No suggestion about the camera, but given that Apple's attitude seems to be to focus more on the more mobile devices for photography (the iPhone and Touch cameras got features, the iPad and mini didn't), that is highly unlikely. You can tell Apple what you want, but you'd probably be money ahead to get a digital camera.
    as to the photos, anything put on via iTunes has to come off via iTunes.Your main alternative would be to look for photo apps that offer file exchange that may give you more functionality.

  • HT4623 please help!! how can i configure my iphone 3gs because i've been updated a new version i did it but it's hard to activate it again.

    please help!! how can i configure my iphone 3gs because i've been updated a new version, i did it but it's hard to activate it again. this message i always recieved in my iphone
    "We're sorry, we are unable to continue with your activation at this time."

    You phone was hacked. You can not get help with it here. Hacking / Jailbreaking voids any warraty and forfeits your right to support. Discussing jailbroken / hacked devices is forbidden by the terms of service here.

  • After updating to Firefox 4, I have lost 4 plugins/add ons due to their NOT being compatible. I can no longer play my bejewelled game. Please help me here. Can I get Firefx 3.6 back? Will that help me?

    Firefox 3.6 allowed me to play games, Firefox 4 upgrade doesn't.Question
    After updating to Firefox 4, I have lost 4 plugins/add ons due to their NOT being compatible. I can no longer play my bejewelled game. Please help me here. Can I get Firefx 3.6 back? Will that help me?

    http://support.mozilla.com/en-US/kb/Installing+a+previous+version+of+Firefox
    http://www.mozilla.com/en-US/firefox/all-older.html

  • I'm getting this problem when trying to update my iphone 3gs it says that the iphone software could not be contacted and I went on youtube got some advise to go into my hard drive to fix the error I have nothing in my host file please help me if you can

    I'm getting this problem when trying to update my iphone 3gs it says that the iphone software could not be contacted and I went on youtube got some advise to go into my hard drive to fix the error I have nothing in my host file please help me if you can this is all new to me.

    Read this: iOS 4: Updating your device to iOS 5 or later
    ... oh I think it is a 3gs or a 3
    This makes a difference. What does it say in Settings > General > About?

  • Please Help me in Labview and MS Access Database Connective

    Please Help me in LabVIEW and MS Access Database Connective through an example . I am new to LabVIEW .I need simple example that take a data from a table and display it on front panel .
    thanks in advance .

    duplicate post

  • I'm in syria and they blocked me from using any VPN service please help without VPN i can't open the store help please ( using iphone 5 version 9.1.4 )

    I'm in syria and they blocked me from using any VPN service please help without VPN i can't open the store help please ( using iphone 5 version 9.1.4 )

    There is nothing that anyone here on a user forum can do to help you.  If it is a local issue in Syria, then you need to take it up with your phone company or authorities there who have prevented you from using VPN.
    Nobody here can help you.

  • Why that when I record a video in my iPhone 4s then I will transfer it to my laptop, the video is in slow motion? Please help so that I can use always my video recording feature. Thanks!

    Why that when I record a video in my iPhone 4s then I will transfer it to my laptop, the video is in slow motion? Please help so that I can use always my video recording feature. Thanks!

    Video is synced from the computer to the iPhone via iTunes. You need to load the video into iTunes, make sure it is iPhone compatible before you do that, and once it is in iTunes, then sync to the iPhone.
    Never said what computer OS you were using. Also, the computer processor, amount of RAM can make a difference with HD video.

  • I HAVE FORGOTTEN THE ANSWERS TO THE SECURITY QUESTIONS AND I DONT REMEMBER MY SECURITY EMAIL I ENTERED WHEN I MADE MY APPLE ID. PLEASE HELP ME WHAT I CAN DO?

    I HAVE FORGOTTEN THE ANSWERS TO THE SECURITY QUESTIONS AND I DONT REMEMBER MY SECURITY EMAIL I ENTERED WHEN I MADE MY APPLE ID. PLEASE HELP ME WHAT I CAN DO?

    If you forgot the answers to your Apple ID security questions - Apple Support
    Apple ID- All about Apple ID security questions
    Manage your Apple ID primary, rescue, alternate, and notification email addresses - Apple Support
    Contact Apple for help with Apple ID account security - Apple Support

  • HT5312 Hi I can't remember the answer to my security questions and I don't think I set up a rescue email adders when opening my account can you please tell me how I can gain access to my account

    Hi I can't remember the answer to my security questions and I don't think I set up a rescue email adders when opening my account can you please tell me how I can gain access to my account

    Didn't the link to contact the iTunes Store staff in the 'Additional Information' section of that article work for you? If you don't already have a valid rescue email address, only Apple itself can reset the questions.
    (90530)

  • Please help me! What can I do to stop receiving lots and lots of emails with all participants questions. I tried what was sugested but it didn't work!

    Please help me! What can I do to stop receiving lots and lots of emails with all participants questions? I tried what was suggested but it didn't work.

    You got your answers in this thread here and you marked it as correct.
    https://discussions.apple.com/message/16541734#16541734
    When you get to the email preferences page to make the changes, did you click on "Save" at the bottom of that page to lock in the changes that you made?

  • Please help me ! I can't remember my security questions answers

    Please help me ! I can't remember my security questions answers and i can't resend them to my email
    And my rescue email is activated but apple can not resend me the answers on it
    What can i do ?
    I can't purchase any apps from appstore using my credit
    Please help me

    Alternatives for Help Resetting Security Questions and Rescue Mail
         1. Apple ID- All about Apple ID security questions.
         2. Rescue email address and how to reset Apple ID security questions
         3. Apple ID- Contacting Apple for help with Apple ID account security.
         4. Fill out and submit this form. Select the topic, Account Security.
         5.  Call Apple Customer Service: Contacting Apple for support in your
              country and ask to speak to Account Security.
    How to Manage your Apple ID: Manage My Apple ID

  • Since installing FF4 my pages are all scrambled..... black squiggley lines that sometimes fills the whole page or different parts. It is driving me crazy! PLEASE HELP! If I can't figure it out i will have to unistall and that will suck!

    Since installing FF4 my pages are all scrambled..... black squiggley lines that sometimes fills the whole page or different parts. It is driving me crazy! PLEASE HELP! If I can't figure it out i will have to unistall and that will suck!

    Since installing FF4 my pages are all scrambled..... black squiggley lines that sometimes fills the whole page or different parts. It is driving me crazy! PLEASE HELP! If I can't figure it out i will have to unistall and that will suck!

Maybe you are looking for

  • Help needed in sqlservers connection

    Hi, I have two database in different servers and i need to access one db object in another db. for ex, server1 (db1) and server2(db2(tableA,tableB) ) I will be writing a stored procedure in in db1 and i wanted to access the TableA's data of db2. i am

  • Captivate 8 pausing on PPT animations instead of playing through to the end of the slide.

    I imported a 26-slide PowerPoint 2007 presentation with animations into Captivate 8 and added two separate Captivate 8 simulations. When I preview, Captivate pauses at each and every animation. I would like for it to play through the entire slide tha

  • File.exists() - new filename

    Hi all, I'm looking for a method which creates a new fileName, if a file in a Directory already exists. if the oldfileName is "file1.txt" the new Filename should be "file2.txt" String newFilename = ""; if (file.exists()) newFilename  = createNewFilen

  • Access Connections Windows 7 Not detecting port

    hey everyone, been having this issue where a windows 7 machine does not detect a local lan port when docked in thus not switching off wireless and onto the LAN. I've been running all of the other XP machines and it appears that they detect and ask wh

  • How can I see the contacts icon in iPhone 6 plus iOS 8 ?

    I can se the icon of Contacs list in the iPhone 6plus, this already have the latest actualization but I can find where is the icon ! Help!