This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
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


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
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: 10170
    
    8

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
 
Similar Threads
Applet not inited problems
Applet Security Manager
Encapsulation and class design.
Window in Applet
help, help, help.