Irfan Basha [
https://community.jboss.org/people/irbash] created the discussion
"Encrypted class loading with jboss 5.1"
To view the discussion, visit:
https://community.jboss.org/message/796705#796705
--------------------------------------------------------------
Hello All,
We are using
http://www.coderanch.com/forums/f-63/JBoss?OWASP_CSRFTOKEN=644T-1D3Y-OILF...
jboss 5.1 to deploy our application. Now we want to secure our .class files, so we are
trying to encrypt the .class files.
but once we use encrypted .class files, jboss throws error (rather warnings saying
WARN [org.jboss.detailed.classloader.ClassLoaderManager] (main) Unexpected error during
load of:xxx.xxx.UserController
http://docs.oracle.com/javase/7/docs/api/java/lang/ClassFormatError.html
java.lang.ClassFormatError: Unknown constant tag 80 in class file xxx/xxx/UserController)
To solve this issue, I got the source of jboss-classloader.jar (This jar is in /lib folder
of jboss), and I saw that the class BaseClaseLoader is the class which finally calls
jvm's classloader.
Hence I changed the code of BaseClassLoader's loadClassLocally method, and decrypted
the class before it calls jvm's classloader. And it worked.
Now I dont want to modify jboss's source code hence I am looking for a way to do this
without modifying the jboss libraries. I was going through
http://java.dzone.com/articles/jboss-microcontainer-classloading
http://java.dzone.com/articles/jboss-microcontainer-classloading and I feel it is possible
to load encrypted classes into jboss by creating custom ClassLoaderPolicy. I tried a lot
to do this, but I am not able to get it working.
Can some one tell me how I can add a custom class loader to jboss 5.1 which can decrypt
the .class files before loading it.
Thanks,
Irfan
--------------------------------------------------------------
Reply to this message by going to Community
[
https://community.jboss.org/message/796705#796705]
Start a new discussion in JBoss Microcontainer at Community
[
https://community.jboss.org/choose-container!input.jspa?contentType=1&...]