can I check if a Java applet certificate is trusted before running my applet?

I have a signed applet on a website. Because of this, the Java security dialog appears, and the user needs to grant permission to the applet before it can do it's work. What I want to do is this:

  • I want the website to explain the security dialog box to the user before it comes up. The page will show some explanation text in a div, and after a few seconds, the security dialog will appear.
  • If the user already allowed the certificate in a previous session, it should just run the applet without any extra dialog.

The problem is that the security dialog appears as soon as the applet is embedded in the page. I can delay embedding, but there's no way to check it's permissions from the applet itself, since it needs to do it before it's loaded.

Perhaps I could load a second, normal applet that runs invisibly, and checks the permissions. But how would I go about doing that? Are there any Java classes that can check if a certificate has been trusted by the client?

Thanks.

6
задан lifeformed 4 May 2011 в 19:20
поделиться