Package net.sourceforge.jnlp.security
Class SecurityDialogs
java.lang.Object
net.sourceforge.jnlp.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 enum
The types of access which may need user permission.static enum
Types of dialogs we can create -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
static net.sourceforge.jnlp.security.dialogresults.AccessWarningPaneComplexReturn
showAccessWarningDialog
(SecurityDialogs.AccessType accessType, JNLPFile file, Object[] extras) Shows a warning dialog for different types of system access (i.e.static net.sourceforge.jnlp.security.dialogresults.NamePassword
showAuthenicationPrompt
(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 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.static boolean
showMatchingALACAttributePanel
(JNLPFile file, URL documentBase, Set<URL> remoteUrls) static boolean
showMissingALACAttributePanel
(JNLPFile file, URL codeBase, Set<URL> remoteUrls) static boolean
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.static net.sourceforge.jnlp.security.dialogresults.YesNoSandboxLimited
Shows a warning dialog for when a plugin applet is unsigned.
-
Constructor Details
-
SecurityDialogs
public SecurityDialogs()
-
-
Method Details
-
showAccessWarningDialog
public static net.sourceforge.jnlp.security.dialogresults.AccessWarningPaneComplexReturn showAccessWarningDialog(SecurityDialogs.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
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. IfaccessType
is one ofSecurityDialogs.AccessType.VERIFIED
orSecurityDialogs.AccessType.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 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 warningcertVerifier
- the JarCertVerifier used to verify this applicationsecurityDelegate
- 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(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
-
show511Dialogue
-