aspose file tools*
The moose likes Applets and the fly likes Restrict access of an applet to classes in a package Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Applets
Bookmark "Restrict access of an applet to classes in a package" Watch "Restrict access of an applet to classes in a package" New topic
Author

Restrict access of an applet to classes in a package

Felix Sima
Ranch Hand

Joined: Feb 06, 2008
Posts: 42
Hi.

I'm new to applets and security and I've received the task to restrict an applet to use any other class except the classes in package "mypackage".
Can you give me some hints of how to do this (i didn't find anything helpful using google) . It is possible to do this by modifying only java.policy file?

Thanks in advance.

Bye,
Felix
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 10523
    
    9

You will have to elaborate on "restrict an applet to use any other class except the classes in package "mypackage"
What is restrict? Not use? As in when you code? Anything else?


[How to ask questions] [Donate a pint, save a life!] [Onff-turn it on!]
Felix Sima
Ranch Hand

Joined: Feb 06, 2008
Posts: 42
Hi.

I've found the answer, thanks.

grant codeBase "file:${jboss.home}/server/default/deploy/<path to my jars>/-" {
permission java.lang.RuntimePermission "accessClassInPackage.mypackage";
permission java.lang.RuntimePermission "accessClassInPackage.mypackage.*";
};
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Restrict access of an applet to classes in a package