Class SecurityDialogs
java.lang.Object
net.adoptopenjdk.icedteaweb.client.parts.dialogs.security.SecurityDialogs
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.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumTypes of dialogs we can create -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static DialogResultgetUserResponse(SecurityDialogMessage message) Posts the message to the SecurityThread and gets the response.static booleanshowAccessWarningDialog(AccessType accessType, JNLPFile file, Object[] extras) Shows a warning dialog for different types of system access (i.e.static NamePasswordshowAuthenticationPrompt(String host, int port, String prompt, 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, URL documentBase, List<URL> remoteUrls) static booleanshowMissingALACAttributePanel(JNLPFile file, URL codeBase, List<URL> remoteUrls) static booleanstatic YesNoSandboxshowPartiallySignedWarningDialog(JNLPFile file, CertVerifier certVerifier, SecurityDelegate securityDelegate) Shows a warning dialog for when an applet or application is partially signed.static YesNoSandboxLimitedShows a warning dialog for when a plugin applet is unsigned.
-
Field Details
-
LOG
-
-
Constructor Details
-
SecurityDialogs
public SecurityDialogs()
-
-
Method Details
-
showAccessWarningDialog
public static AccessWarningPaneComplexReturn showAccessWarningDialog(AccessType accessType, JNLPFile file, 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
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(String host, int port, String prompt, 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:
SecurityException- if the caller does not have the appropriate permissions.
-
showMissingALACAttributePanel
-
showMatchingALACAttributePanel
-
showMissingPermissionsAttributeDialogue
-
getUserResponse
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
-