• Post Reply Bookmark Topic Watch Topic
  • New Topic

Signed jar becomes unsigned if loaded by URLClassLoader  RSS feed

 
Zandis Murāns
Ranch Hand
Posts: 174
Java Java ME Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am loading a signed jar file (named a.jar) by URLClassLoader.

After that, if I try to invoke some method that needs more permissions than sandboxed (I am trying this in applet), I am getting java.security.AccessControlException: (access denied). Why?
If I load this a.jar file by specifying it in applets tag "archive" attribute, everything works just great. How comes that URLClassLoader looses this signature information (and trust)?
 
Nikolay Antipov
Greenhorn
Posts: 2
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi! It seems to I have similar problem. I solved it. Description here:
http://stackoverflow.com/questions/7446009/signed-applet-loads-signed-jar-files-using-urlclassloader-with-security-issue
.

Basic solution is to create custom SecurityManager which will permit all you need and substitute system manager with yours.

For example, manager who permits all.





 
Zandis Murāns
Ranch Hand
Posts: 174
Java Java ME Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, thanks a lot, man!
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!