Class SecurityDialogs
- java.lang.Object
-
- net.adoptopenjdk.icedteaweb.client.parts.dialogs.security.SecurityDialogs
-
public class SecurityDialogs extends java.lang.ObjectA 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
SecurityDialogdirectly.All of these methods post a message to the
SecurityDialogMessageHandlerand block waiting for a response.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classSecurityDialogs.DialogTypeTypes of dialogs we can create
-
Constructor Summary
Constructors Constructor Description SecurityDialogs()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description private static DialogResultgetUserResponse(SecurityDialogMessage message)Posts the message to the SecurityThread and gets the response.static booleanshow511Dialogue(Resource r)static AccessWarningPaneComplexReturnshowAccessWarningDialog(AccessType accessType, JNLPFile file, java.lang.Object[] extras)Shows a warning dialog for different types of system access (i.e.static NamePasswordshowAuthenticationPrompt(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.static YesNoSandboxshowCertWarningDialog(AccessType accessType, JNLPFile file, CertVerifier certVerifier, SecurityDelegate securityDelegate)Shows a security warning dialog according to the specified type of access.static booleanshowMatchingALACAttributePanel(JNLPFile file, java.net.URL documentBase, java.util.List<java.net.URL> remoteUrls)static booleanshowMissingALACAttributePanel(JNLPFile file, java.net.URL codeBase, java.util.List<java.net.URL> remoteUrls)static booleanshowMissingPermissionsAttributeDialogue(JNLPFile file)static YesNoSandboxshowPartiallySignedWarningDialog(JNLPFile file, CertVerifier certVerifier, SecurityDelegate securityDelegate)Shows a warning dialog for when an applet or application is partially signed.static YesNoSandboxLimitedshowUnsignedWarningDialog(JNLPFile file)Shows a warning dialog for when a plugin applet is unsigned.
-
-
-
Field Detail
-
LOG
private static final Logger LOG
-
-
Method Detail
-
showAccessWarningDialog
public static AccessWarningPaneComplexReturn showAccessWarningDialog(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 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 YesNoSandbox showCertWarningDialog(AccessType accessType, JNLPFile file, CertVerifier certVerifier, SecurityDelegate securityDelegate)
Shows a security warning dialog according to the specified type of access. IfaccessTypeis one ofAccessType.VERIFIEDorAccessType.UNVERIFIED, extra details will be available with regards to code signing and signing certificates.- Parameters:
accessType- the type of warning dialog to showfile- the JNLPFile associated with this warningcertVerifier- the JarCertVerifier used to verify this applicationsecurityDelegate- 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 YesNoSandbox showPartiallySignedWarningDialog(JNLPFile file, CertVerifier certVerifier, SecurityDelegate securityDelegate)
Shows a warning dialog for when an applet or application is partially signed.- Parameters:
file- the JNLPFile associated with this warningcertVerifier- the JarCertVerifier used to verify this applicationsecurityDelegate- the delegate for security atts.- Returns:
- true if permission was granted by the user, false otherwise.
-
showAuthenticationPrompt
public static NamePassword showAuthenticationPrompt(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 neededport- The port being accessedprompt- The prompt (realm) as presented by the servertype- 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.List<java.net.URL> remoteUrls)
-
showMatchingALACAttributePanel
public static boolean showMatchingALACAttributePanel(JNLPFile file, java.net.URL documentBase, java.util.List<java.net.URL> remoteUrls)
-
showMissingPermissionsAttributeDialogue
public static boolean showMissingPermissionsAttributeDialogue(JNLPFile file)
-
getUserResponse
private static DialogResult getUserResponse(SecurityDialogMessage message)
Posts the message to the SecurityThread and gets the response. Blocks until a response has been received. It's safe to call this from an EventDispatchThread.- Parameters:
message- the SecurityDialogMessage indicating what type of dialog to display- Returns:
- The user's response. Can be null. The exact answer depends on the type of message, but generally an Integer corresponding to the value 0 indicates success/proceed, and everything else indicates failure
-
show511Dialogue
public static boolean show511Dialogue(Resource r)
-
-