Skip to Main Content

Java Security

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Regular expression in java.policy file

f1b8e29b-90b5-425a-8069-a2affaaa3278May 9 2018 — edited May 9 2018

I have a third party security provider jar that docs recommend to be placed into the jre/lib/ext folder.  While it can be placed elsewhere in the general class path the docs of this library make it clear that exceptions could result depending on classloader start order etc.

The default java.policy has the following

grant codeBase "file:${{java.ext.dirs}}/*" {

  permission java.security.AllPermission;

};

However, if I place my provider jar in the extension folder I do not AllPermission to applied to my provider jar.  Ideally I want to wild card the file param of grant codeBase.  i.e. all files exception the security provider.

Otherwise do I really have to list the following for each jar ?

grant codeBase "file:${{java.ext.dirs}}/jar1.jar" {

  permission java.security.AllPermission;

};

grant codeBase "file:${{java.ext.dirs}}/jart2.jar" {

  permission java.security.AllPermission;

};

Thank you

Comments

Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Jun 6 2018
Added on May 9 2018
0 comments
226 views