What does this method do checkCreateClassLoader in the security manager class

88 views Asked by At

I would like to know what the checkCreateClassLoader method does , its not very clear in the java api doc.Yes , let say I have an application and want to avoid someone dumping my classes during run time(using java agent or reflection). Can I use this method for avoiding this . Thanks

MalikDz

1

There are 1 answers

0
Thilo On

Let say I have an application and want to avoid someone dumping my classes during run time(using java agent or reflection). Can I use this method for avoiding this?

No.

First of all "Java Agent" already implies complete control over the runtime environment.

If you have a user running your code on their own machine, they can get at your class files.

If the code is running on your machine (but the user can somehow upload his own JAR files), then you can use a custom Security Manager, maybe in combination with a custom ClassLoader, to disable reflection and probably also access to the bytecode of classes (and also restrict communication channels that would be required to send this "leaked" data back to the user).