Class SecurityDialogs


  • public class SecurityDialogs
    extends java.lang.Object

    A factory for showing many possible types of security warning to the user.

    This contains all the public methods that classes outside this package should use instead of using SecurityDialog directly.

    All of these methods post a message to the SecurityDialogMessageHandler and block waiting for a response.

    • Constructor Detail

      • SecurityDialogs

        public SecurityDialogs()
    • Method Detail

      • showAccessWarningDialog

        public static net.sourceforge.jnlp.security.dialogresults.AccessWarningPaneComplexReturn showAccessWarningDialog​(SecurityDialogs.AccessType accessType,
                                                                                                                         JNLPFile file,
                                                                                                                         java.lang.Object[] extras)
        Shows a warning dialog for different types of system access (i.e. file open/save, clipboard read/write, printing, etc).
        Parameters:
        accessType - the type of system access requested.
        file - the jnlp file associated with the requesting application.
        extras - array of objects used as extra.toString or similarly later
        Returns:
        true if permission was granted by the user, false otherwise.
      • showUnsignedWarningDialog

        public static net.sourceforge.jnlp.security.dialogresults.YesNoSandboxLimited showUnsignedWarningDialog​(JNLPFile file)
        Shows a warning dialog for when a plugin applet is unsigned. This is used with 'high-security' setting.
        Parameters:
        file - the file to be base as information source for this dialogue
        Returns:
        true if permission was granted by the user, false otherwise.
      • showCertWarningDialog

        public static net.sourceforge.jnlp.security.dialogresults.YesNoSandbox showCertWarningDialog​(SecurityDialogs.AccessType accessType,
                                                                                                     JNLPFile file,
                                                                                                     CertVerifier certVerifier,
                                                                                                     JNLPClassLoader.SecurityDelegate securityDelegate)
        Shows a security warning dialog according to the specified type of access. If accessType is one of SecurityDialogs.AccessType.VERIFIED or SecurityDialogs.AccessType.UNVERIFIED, extra details will be available with regards to code signing and signing certificates.
        Parameters:
        accessType - the type of warning dialog to show
        file - the JNLPFile associated with this warning
        certVerifier - the JarCertVerifier used to verify this application
        securityDelegate - the delegate for security atts.
        Returns:
        RUN if the user accepted the certificate, SANDBOX if the user wants the applet to run with only sandbox permissions, or CANCEL if the user did not accept running the applet
      • showPartiallySignedWarningDialog

        public static net.sourceforge.jnlp.security.dialogresults.YesNoSandbox showPartiallySignedWarningDialog​(JNLPFile file,
                                                                                                                CertVerifier certVerifier,
                                                                                                                JNLPClassLoader.SecurityDelegate securityDelegate)
        Shows a warning dialog for when an applet or application is partially signed.
        Parameters:
        file - the JNLPFile associated with this warning
        certVerifier - the JarCertVerifier used to verify this application
        securityDelegate - the delegate for security atts.
        Returns:
        true if permission was granted by the user, false otherwise.
      • showAuthenicationPrompt

        public static net.sourceforge.jnlp.security.dialogresults.NamePassword showAuthenicationPrompt​(java.lang.String host,
                                                                                                       int port,
                                                                                                       java.lang.String prompt,
                                                                                                       java.lang.String type)
        Present a dialog to the user asking them for authentication information, and returns the user's response. The caller must have NetPermission("requestPasswordAuthentication") for this to work.
        Parameters:
        host - The host for with authentication is needed
        port - The port being accessed
        prompt - The prompt (realm) as presented by the server
        type - The type of server (proxy/web)
        Returns:
        an array of objects representing user's authentication tokens
        Throws:
        java.lang.SecurityException - if the caller does not have the appropriate permissions.
      • showMissingALACAttributePanel

        public static boolean showMissingALACAttributePanel​(JNLPFile file,
                                                            java.net.URL codeBase,
                                                            java.util.Set<java.net.URL> remoteUrls)
      • showMatchingALACAttributePanel

        public static boolean showMatchingALACAttributePanel​(JNLPFile file,
                                                             java.net.URL documentBase,
                                                             java.util.Set<java.net.URL> remoteUrls)
      • showMissingPermissionsAttributeDialogue

        public static boolean showMissingPermissionsAttributeDialogue​(JNLPFile file)
      • show511Dialogue

        public static boolean show511Dialogue​(Resource r)