JDK-6474018 : grant signed by fails if certificate is being stored in browser keystore
  • Type: Enhancement
  • Component: deploy
  • Sub-Component: plugin
  • Affected Version: 5.0u8
  • Priority: P3
  • Status: Closed
  • Resolution: Not an Issue
  • OS: windows_xp
  • CPU: x86
  • Submitted: 2006-09-22
  • Updated: 2010-09-09
  • Resolved: 2010-09-09
Related Reports
Relates :  
Description
It is possible to grant some applet permissions using grant signedBy
if the certificate which was used to sign the applet is being stored in
a keystore on disk. However, if the browser keystore of IE is being
used, then this does not work.


keystore "somecerts","jks";

grant signedBy "someone", codebase "https://somepath/someapplet.jar"
{
   permission java.io.FilePermission "<<ALL FILES>>", "read,execute,write";
   permission java.util.PropertyPermission "user.home", "read";
};

AFAIK the browser keystore, unlike standard keystores, doesn't feature aliases.
Hence it could well be that the above is simply impossible.

-------------------------------------------------------------------------------
http://java.sun.com/docs/books/tutorial/security/toolsign/wstep3.html

To grant code signed by |susan| permission to read any files in the |C:\TestData|
directory, you need to create a policy entry granting this permission. Note
that "Code signed by |susan|" is an abbreviated way of saying "Code in a
class file contained in a JAR file, where the JAR file was signed using the
private key corresponding to the public key that appears in a keystore
certificate in an entry aliased by |susan|."
-------------------------------------------------------------------------------

If the above was true then this would be merely a bug against the documentation:

http://java.sun.com/j2se/1.5.0/docs/guide/deployment/deployment-guide/keystores.html

-------------------------------------------------------------------------------
Overview

Java Plug-in and Java Web Start support browser keystore in Internet Explorer and Mozilla; certificates and keys in browser keystores are used for the following purpose:

    * Signature signing verification
    * HTTPS server authentication
    * HTTPS client authentication
-------------------------------------------------------------------------------

Comments
EVALUATION As submitter mentioned, the signedBy will only take alias name from JRE keystore, not IE browser keystore, as browser keystore doesn't feature aliases. SignedBy is only used in policy file. There are other ways for Java plugin and Java webstart to do certificate verification, which do use certificate inside browser keystore as mentioned in our documentation. So this is not a bug.
11-10-2006