I plan on allowing users of my program to create their own subclasses to use as modules in my program. I've always read that classloaders were insecure, and I completely understand why. What I want to know is if I'm able to use something similar to SecurityManager to allow loading a class, but restricting its access to other packages within the project, and the jdk. My users should only need certain libraries to create their modules, but I cannot just have them injecting malicious code into the program.
Is it possible to use SecurityManager or something similar to do this?