use of org.kse.utilities.history.KeyStoreHistory in project keystore-explorer by kaikramer.
the class DExamineSsl method initComponents.
private void initComponents() {
jlSslHost = new JLabel(res.getString("DExamineSsl.jlSslHost.text"));
jcbSslHost = new JComboBox<String>();
jcbSslHost.setEditable(true);
jcbSslHost.setPrototypeDisplayValue("XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX");
jcbSslHost.setToolTipText(res.getString("DExamineSsl.jtfSslHost.tooltip"));
jcbSslHost.setModel(new DefaultComboBoxModel<String>(getSslHosts()));
jlSslPort = new JLabel(res.getString("DExamineSsl.jlSslPort.text"));
jcbSslPort = new JComboBox<String>();
jcbSslPort.setEditable(true);
jcbSslPort.setToolTipText(res.getString("DExamineSsl.jtfSslPort.tooltip"));
jcbSslPort.setModel(new DefaultComboBoxModel<String>(getSslPorts()));
jcbClientAuth = new JCheckBox(res.getString("DExamineSsl.jlEnableClientAuth.text"));
jcbKeyStore = new JComboBox<KeyStoreHistory>(getKeystoreNames());
jcbKeyStore.setToolTipText(res.getString("DExamineSsl.jcbKeyStore.tooltip"));
jbLoadKeystore = new JButton();
jbLoadKeystore.setIcon(new ImageIcon(getClass().getResource(res.getString("DExamineSsl.jbOpen.image"))));
jbLoadKeystore.setToolTipText(res.getString("DExamineSsl.jbLoadKeystore.tooltip"));
jbOK = new JButton(res.getString("DExamineSsl.jbOK.text"));
jbCancel = new JButton(res.getString("DExamineSsl.jbCancel.text"));
jbCancel.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0), CANCEL_KEY);
jpButtons = PlatformUtil.createDialogButtonPanel(jbOK, jbCancel);
Container pane = getContentPane();
pane.setLayout(new MigLayout("insets dialog, fill", "[para]unrel[right]unrel[]", "[]unrel[]"));
MiGUtil.addSeparator(pane, res.getString("DExamineSsl.jlConnSettings.text"));
pane.add(jlSslHost, "skip");
pane.add(jcbSslHost, "sgx, wrap");
pane.add(jlSslPort, "skip");
pane.add(jcbSslPort, "sgx, wrap para");
MiGUtil.addSeparator(pane, res.getString("DExamineSsl.jlClientAuth.text"));
pane.add(jcbClientAuth, "left, spanx, wrap");
pane.add(new JLabel(res.getString("DExamineSsl.jlKeyStore.text")), "skip");
pane.add(jcbKeyStore, "sgx");
pane.add(jbLoadKeystore, "wrap para");
pane.add(new JSeparator(), "spanx, growx, wrap para");
pane.add(jpButtons, "right, spanx");
jcbClientAuth.addActionListener(new java.awt.event.ActionListener() {
@Override
public void actionPerformed(java.awt.event.ActionEvent evt) {
updateClientAuthComponents();
}
});
jbLoadKeystore.addActionListener(new java.awt.event.ActionListener() {
@Override
public void actionPerformed(java.awt.event.ActionEvent evt) {
OpenAction openAction = new OpenAction(kseFrame);
openAction.actionPerformed(evt);
updateClientAuthComponents();
}
});
jbOK.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent evt) {
okPressed();
}
});
jbCancel.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent evt) {
cancelPressed();
}
});
jbCancel.getActionMap().put(CANCEL_KEY, new AbstractAction() {
private static final long serialVersionUID = 1L;
@Override
public void actionPerformed(ActionEvent evt) {
cancelPressed();
}
});
addWindowListener(new WindowAdapter() {
@Override
public void windowClosing(WindowEvent evt) {
closeDialog();
}
});
updateClientAuthComponents();
setResizable(false);
getRootPane().setDefaultButton(jbOK);
pack();
}
use of org.kse.utilities.history.KeyStoreHistory in project keystore-explorer by kaikramer.
the class KseFrame method addKeyStore.
/**
* Add a KeyStore to the set of loaded KeyStores.
*
* @param keyStore
* KeyStore
* @param keyStoreFile
* KeyStore file
* @param password
* KeyStore password
*/
public void addKeyStore(KeyStore keyStore, File keyStoreFile, Password password) {
KeyStoreHistory history = new KeyStoreHistory(keyStore, keyStoreFile, password);
addKeyStoreHistory(history);
}
use of org.kse.utilities.history.KeyStoreHistory in project keystore-explorer by kaikramer.
the class KseFrame method showSelectedEntryDetails.
private void showSelectedEntryDetails(JTable jtKeyStore, int row) {
jtKeyStore.setRowSelectionInterval(row, row);
// Selection changed - update edit controls
updateCutCopyPasteControls();
KeyStoreHistory history = getActiveKeyStoreHistory();
KeyStore keyStore = history.getCurrentState().getKeyStore();
String alias = getSelectedEntryAlias();
try {
if (KeyStoreUtil.isKeyPairEntry(alias, keyStore)) {
keyPairCertificateChainDetailsAction.showCertificateSelectedEntry();
} else if (KeyStoreUtil.isTrustedCertificateEntry(alias, keyStore)) {
trustedCertificateDetailsAction.showCertificateSelectedEntry();
} else if (KeyStoreUtil.isKeyEntry(alias, keyStore)) {
keyDetailsAction.showKeySelectedEntry();
}
} catch (Exception ex) {
DError.displayError(frame, ex);
}
}
use of org.kse.utilities.history.KeyStoreHistory in project keystore-explorer by kaikramer.
the class KseFrame method addKeyStore.
/**
* Add a KeyStore to the set of loaded KeyStores.
*
* @param keyStore
* KeyStore
* @param keyStoreName
* KeyStore name
* @param password
* KeyStore password
* @param explicitProvider
* Explicitly specify a provider that is used for this keystore
*/
public void addKeyStore(KeyStore keyStore, String keyStoreName, Password password, Provider explicitProvider) {
KeyStoreHistory history = new KeyStoreHistory(keyStore, keyStoreName, password, explicitProvider);
addKeyStoreHistory(history);
}
use of org.kse.utilities.history.KeyStoreHistory in project keystore-explorer by kaikramer.
the class KseFrame method updateKeyStoreTabsText.
private void updateKeyStoreTabsText() {
for (int i = 0; i < histories.size(); i++) {
KeyStoreHistory history = histories.get(i);
KeyStoreTab keyStoreTab = (KeyStoreTab) jkstpKeyStores.getTabComponentAt(i);
// Tab component may not be available yet
if (keyStoreTab != null) {
if (!history.getCurrentState().isSavedState()) {
// Unsaved Changes - append '*'
String title = MessageFormat.format("{0} *", history.getName());
keyStoreTab.updateTitle(title);
} else {
String title = history.getName();
keyStoreTab.updateTitle(title);
}
// Set tooltip text to be the same as is displayed for the
// KeyStore's status bar text
jkstpKeyStores.setToolTipTextAt(i, getKeyStoreStatusText(history));
}
}
}
Aggregations