Class SecurityDialog
- java.lang.Object
-
- net.adoptopenjdk.icedteaweb.client.parts.dialogs.security.SecurityDialog
-
public class SecurityDialog extends java.lang.ObjectProvides methods for showing security warning dialogs for a wide range of JNLP security issues. Note that the security dialogs should be running in the secure AppContext - this class should not be used directly from an applet or application. SeeSecurityDialogsfor a way to show security dialogs.
-
-
Field Summary
Fields Modifier and Type Field Description private AccessTypeaccessTypeThe type of access that this dialog is forprivate java.security.cert.X509Certificatecertprivate CertVerifiercertVerifierprivate SecurityDialogs.DialogTypedialogTypeThe type of dialog we want to showprivate java.lang.Object[]extrasAn optional String array that's only necessary when a dialog label requires some parameters (e.g.private JNLPFilefileThe application file associated with this security warningprivate booleaninitializedWhether or not this object has been fully initializedprivate static LoggerLOGprivate SecurityDialogPanelpanelprivate booleanrequiresSignedJNLPWarningShould show signed JNLP file warningprivate DialogResultvalueprivate ViwableDialogviwableDialog
-
Constructor Summary
Constructors Modifier Constructor Description privateSecurityDialog(SecurityDialogs.DialogType dialogType, java.security.cert.X509Certificate c)Create a SecurityWarningDialog to display information about a single certificateprivateSecurityDialog(SecurityDialogs.DialogType dialogType, AccessType accessType, JNLPFile file)Construct a SecurityDialog to display some sort of access warningprivateSecurityDialog(SecurityDialogs.DialogType dialogType, AccessType accessType, JNLPFile file, java.lang.Object[] extras)Create a SecurityDialog to display some sort of access warning with more informationprivateSecurityDialog(SecurityDialogs.DialogType dialogType, AccessType accessType, JNLPFile file, CertVerifier certVerifier)Create a SecurityDialog to display a certificate-related warning(package private)SecurityDialog(SecurityDialogs.DialogType dialogType, AccessType accessType, JNLPFile file, CertVerifier JarCertVerifier, java.security.cert.X509Certificate cert, java.lang.Object[] extras)privateSecurityDialog(SecurityDialogs.DialogType dialogType, AccessType accessType, CertVerifier certVerifier)Create a SecurityDialog to display a certificate-related warning
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private java.lang.StringcreateTitle()private static java.lang.StringcreateTitle(SecurityDialogs.DialogType dtype, AccessType atype)AccessTypegetAccessType()java.security.cert.X509CertificategetCert()CertVerifiergetCertVerifier()(package private) DialogResultgetDefaultNegativeAnswer()(package private) DialogResultgetDefaultPositiveAnswer()JNLPFilegetFile()private SecurityDialogPanelgetPanel()(package private) static SecurityDialogPanelgetPanel(SecurityDialog sd)(package private) static SecurityDialogPanelgetPanel(SecurityDialogs.DialogType type, SecurityDialog sd)SecurityDialogPanelgetSecurityDialogPanel()(package private) java.lang.StringgetText()DialogResultgetValue()ViwableDialoggetViwableDialog()(package private) java.lang.StringhelpToStdIn()private voidinitDialog()private voidinstallPanel()booleanisInitialized()Returns if this dialog has been fully initialized yet.(package private) DialogResultreadFromStdIn(java.lang.String what)booleanrequiresSignedJNLPWarning()private voidselectDefaultButton()voidsetValue(DialogResult value)static voidshowCertInfoDialog(CertVerifier certVerifier, java.awt.Component parent)Displays CertPath information in a readable table format.static voidshowMoreInfoDialog(CertVerifier certVerifier, SecurityDialog parent)Shows more information regarding jar code signingstatic voidshowSingleCertInfoDialog(java.security.cert.X509Certificate c, java.awt.Window parent)Displays a single certificate's information.
-
-
-
Field Detail
-
LOG
private static final Logger LOG
-
dialogType
private final SecurityDialogs.DialogType dialogType
The type of dialog we want to show
-
accessType
private final AccessType accessType
The type of access that this dialog is for
-
panel
private SecurityDialogPanel panel
-
file
private final JNLPFile file
The application file associated with this security warning
-
certVerifier
private final CertVerifier certVerifier
-
cert
private final java.security.cert.X509Certificate cert
-
extras
private final java.lang.Object[] extras
An optional String array that's only necessary when a dialog label requires some parameters (e.g. showing which address an application is trying to connect to).
-
initialized
private boolean initialized
Whether or not this object has been fully initialized
-
value
private DialogResult value
-
viwableDialog
private ViwableDialog viwableDialog
-
requiresSignedJNLPWarning
private boolean requiresSignedJNLPWarning
Should show signed JNLP file warning
-
-
Constructor Detail
-
SecurityDialog
SecurityDialog(SecurityDialogs.DialogType dialogType, AccessType accessType, JNLPFile file, CertVerifier JarCertVerifier, java.security.cert.X509Certificate cert, java.lang.Object[] extras)
-
SecurityDialog
private SecurityDialog(SecurityDialogs.DialogType dialogType, AccessType accessType, JNLPFile file)
Construct a SecurityDialog to display some sort of access warning
-
SecurityDialog
private SecurityDialog(SecurityDialogs.DialogType dialogType, AccessType accessType, JNLPFile file, CertVerifier certVerifier)
Create a SecurityDialog to display a certificate-related warning
-
SecurityDialog
private SecurityDialog(SecurityDialogs.DialogType dialogType, AccessType accessType, CertVerifier certVerifier)
Create a SecurityDialog to display a certificate-related warning
-
SecurityDialog
private SecurityDialog(SecurityDialogs.DialogType dialogType, AccessType accessType, JNLPFile file, java.lang.Object[] extras)
Create a SecurityDialog to display some sort of access warning with more information
-
SecurityDialog
private SecurityDialog(SecurityDialogs.DialogType dialogType, java.security.cert.X509Certificate c)
Create a SecurityWarningDialog to display information about a single certificate
-
-
Method Detail
-
isInitialized
public boolean isInitialized()
Returns if this dialog has been fully initialized yet.- Returns:
- true if this dialog has been initialized, and false otherwise.
-
showMoreInfoDialog
public static void showMoreInfoDialog(CertVerifier certVerifier, SecurityDialog parent)
Shows more information regarding jar code signing- Parameters:
certVerifier- the JarCertVerifier used to verify this applicationparent- the parent NumberOfArguments pane
-
showCertInfoDialog
public static void showCertInfoDialog(CertVerifier certVerifier, java.awt.Component parent)
Displays CertPath information in a readable table format.- Parameters:
certVerifier- the JarCertVerifier used to verify this applicationparent- the parent NumberOfArguments pane
-
showSingleCertInfoDialog
public static void showSingleCertInfoDialog(java.security.cert.X509Certificate c, java.awt.Window parent)Displays a single certificate's information.- Parameters:
c- the X509 certificate.parent- the parent pane.
-
initDialog
private void initDialog()
-
createTitle
private java.lang.String createTitle()
-
createTitle
private static java.lang.String createTitle(SecurityDialogs.DialogType dtype, AccessType atype)
-
getAccessType
public AccessType getAccessType()
-
getFile
public JNLPFile getFile()
-
getCertVerifier
public CertVerifier getCertVerifier()
-
getCert
public java.security.cert.X509Certificate getCert()
-
getPanel
private SecurityDialogPanel getPanel()
-
getPanel
static SecurityDialogPanel getPanel(SecurityDialog sd)
-
getPanel
static SecurityDialogPanel getPanel(SecurityDialogs.DialogType type, SecurityDialog sd)
-
installPanel
private void installPanel()
-
selectDefaultButton
private void selectDefaultButton()
-
setValue
public void setValue(DialogResult value)
-
getValue
public DialogResult getValue()
-
requiresSignedJNLPWarning
public boolean requiresSignedJNLPWarning()
-
getDefaultNegativeAnswer
DialogResult getDefaultNegativeAnswer()
-
getDefaultPositiveAnswer
DialogResult getDefaultPositiveAnswer()
-
getText
java.lang.String getText()
-
readFromStdIn
DialogResult readFromStdIn(java.lang.String what)
-
helpToStdIn
java.lang.String helpToStdIn()
-
getViwableDialog
public ViwableDialog getViwableDialog()
-
getSecurityDialogPanel
public SecurityDialogPanel getSecurityDialogPanel()
-
-