Re: Jogl Build Headache
Posted by Penny on Dec 08, 2013; 1:33am
URL: https://forum.jogamp.org/Jogl-Build-Headache-tp4030758p4030822.html
Hiya,
I believe I have resolved my problem completely.
My loader applet downloads the additional jars and saves them to user.home
I have designed my own class loader that has the applet class loader as its parent so it has the loader applet trusted privileges.
The class loader goes through each downloaded jar and through each entry and verifies that it is signed and valid with the same certificate used to sign and trust the loader applet.
If the class certificate has been verified I then call defineClass using the same byte buffer that I loaded to verify the certificate and a code source object.
Some classes throw a LinkageError and I believe it is because these classes are already defined so I ignore and move on to the next class. Classes may already be defined during resolving of other classes. I hope that the classes that are automatically loaded during resolving have the trusted privileges.
If any class fails its certificate the loader halts with a message "Stop trying to hack my software you loser!" haha
Result: I invoked a method on a dynamically loaded class and it was able to access its own classloader as well as the current thread context class loader which I do believe should raise a access control exception if it did not have the trusted privileges.
I guess it will take me a few weeks to port my test project classloader into my project but fingers crossed!!! :)