/* SecuritySettingsPanel.java -- Display possible security settings. Copyright (C) 2010 Red Hat This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ package net.sourceforge.jnlp.controlpanel; import java.awt.BorderLayout; import java.awt.Component; import java.awt.Dimension; import java.awt.GridBagConstraints; import java.awt.GridBagLayout; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.Box; import javax.swing.JCheckBox; import javax.swing.JLabel; import javax.swing.JPanel; import net.sourceforge.jnlp.config.DeploymentConfiguration; import net.sourceforge.jnlp.runtime.Translator; /** * This provides a way for the user to modify the security settings through a * GUI. * * @author Andrew Su (asu@redhat.com, andrew.su@utoronto.ca) * */ @SuppressWarnings("serial") public class SecuritySettingsPanel extends NamedBorderPanel implements ActionListener { private DeploymentConfiguration config; // NOTE: All the ones listed with "Default" are in Oracle's implementation. // Not shown on deployments.properties webpage. Add support for these later! /** List of properties used by this panel */ public static String[] properties = { "deployment.security.askgrantdialog.show", "deployment.security.askgrantdialog.notinca", "deployment.security.browser.keystore.use", // default TRUE "deployment.security.clientauth.keystore.auto", // Default FALSE "deployment.security.jsse.hostmismatch.warning", "deployment.security.https.warning.show", // Default FALSE "deployment.security.sandbox.awtwarningwindow", "deployment.security.sandbox.jnlp.enhanced", "deployment.security.validation.crl", // Default TRUE "deployment.security.validation.ocsp", // Default FALSE "deployment.security.pretrust.list", // Default TRUE "deployment.security.blacklist.check", // Default TRUE "deployment.security.password.cache", // Default TRUE "deployment.security.SSLv2Hello", // Default FALSE "deployment.security.SSLv3", // Default TRUE "deployment.security.TLSv1", // Default TRUE // "deployment.security.mixcode", // Default TRUE }; /** * This creates a new instance of the security settings panel. * * @param config * Loaded DeploymentConfiguration file. */ public SecuritySettingsPanel(DeploymentConfiguration config) { super(Translator.R("CPHeadSecurity"), new BorderLayout()); this.config = config; addComponents(); } /** * Add the components to the panel. */ private void addComponents() { JPanel topPanel = new JPanel(new GridBagLayout()); GridBagConstraints c = new GridBagConstraints(); JLabel description = new JLabel("" + Translator.R("CPSecurityDescription") + "