2 Replies Latest reply: Jun 7, 2010 6:51 PM by 843811 RSS

    Determine when signed applet certification is rejected

    843811
      Hello,

      When a signed applet is first run and the cert is verified, the dialog allows the user to "Run" or "Cancel". If they click "Cancel" the applet continues to run, but without the permissions it may need to do its job. Is there a way for the applet or the web page to determine if the user clicked "Cancel"?

      The applet can of course try to do a privileged operation and catch AccessControlException, but that doesn't necessarily mean that the user clicked "Cancel"; maybe OS or browser security settings are preventing the applet from doing the operation.

      Thanks
        • 1. Re: Determine when signed applet certification is rejected
          843811
          Exactly the same issue am going through.I am clicking on 'cancel' when I get the security alert. The applet still loads but I want to show some information to the user about the underlying exception that is happen to occur.
          Anyway that I can determine when user click on 'Cancel' button? When user clicks on 'Run' everything is working fine as expected.

          Help please.
          R.

          Edited by: -Ram- on Apr 2, 2010 3:04 AM
          • 2. Re: Determine when signed applet certification is rejected
            843811
            Yes, you can check that a permission is allowed without attempting that action. You will need to change the 'permission' object to be of the type of permission that you want to check.

            try {
            java.util.PropertyPermission permission = new java.util.PropertyPermission("my.fav.property", "read");
            java.security.AccessController.checkPermission(permission);
            System.out.println("Permission Check Passed");
            } catch (AccessControlException e) {
            System.out.println("Permission Check Failed");
            }