keyStoreListMouseClicked(evt);
}
});
keyStoreScrollPane.setViewportView(keyStoreList);
GroupLayout keyStorePanelLayout = new GroupLayout(keyStorePanel);
keyStorePanel.setLayout(keyStorePanelLayout);
keyStorePanelLayout.setHorizontalGroup(
keyStorePanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
.addGroup(GroupLayout.Alignment.TRAILING, keyStorePanelLayout.createSequentialGroup()
.addGroup(keyStorePanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
.addComponent(deleteButton)
.addComponent(keyStoreScrollPane, GroupLayout.DEFAULT_SIZE, 181, Short.MAX_VALUE))
.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
.addGroup(keyStorePanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
.addGroup(keyStorePanelLayout.createSequentialGroup()
.addComponent(setActiveButton)
.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED, 100, Short.MAX_VALUE)
.addComponent(showAliasButton))
.addComponent(aliasScrollPane, GroupLayout.DEFAULT_SIZE, 202, Short.MAX_VALUE)))
);
keyStorePanelLayout.setVerticalGroup(
keyStorePanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
.addGroup(GroupLayout.Alignment.TRAILING, keyStorePanelLayout.createSequentialGroup()
.addGroup(keyStorePanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
.addComponent(aliasScrollPane, 0, 0, Short.MAX_VALUE)
.addComponent(keyStoreScrollPane, GroupLayout.DEFAULT_SIZE, 95, Short.MAX_VALUE))
.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
.addGroup(keyStorePanelLayout.createParallelGroup(GroupLayout.Alignment.BASELINE)
.addComponent(deleteButton)
.addComponent(setActiveButton, GroupLayout.PREFERRED_SIZE, 18, GroupLayout.PREFERRED_SIZE)
.addComponent(showAliasButton)))
);
keyStorePanelLayout.linkSize(SwingConstants.VERTICAL, new Component[] {deleteButton, setActiveButton, showAliasButton});
certificatejTabbedPane.addTab("KeyStore", keyStorePanel);
fileLabel.setText("File");
browseButton.setText("Browse");
browseButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent evt) {
browseButtonActionPerformed(evt);
}
});
passwordPkcs12Label.setText("Password");
addPkcs12Button.setText("Add to keystore");
addPkcs12Button.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent evt) {
addPkcs12ButtonActionPerformed(evt);
}
});
GroupLayout pkcs12PanelLayout = new GroupLayout(pkcs12Panel);
pkcs12Panel.setLayout(pkcs12PanelLayout);
pkcs12PanelLayout.setHorizontalGroup(
pkcs12PanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
.addGroup(pkcs12PanelLayout.createSequentialGroup()
.addGroup(pkcs12PanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
.addGroup(GroupLayout.Alignment.TRAILING, pkcs12PanelLayout.createSequentialGroup()
.addContainerGap()
.addComponent(fileTextField, GroupLayout.DEFAULT_SIZE, 296, Short.MAX_VALUE)
.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
.addComponent(browseButton))
.addGroup(pkcs12PanelLayout.createSequentialGroup()
.addGap(12, 12, 12)
.addComponent(fileLabel))
.addGroup(pkcs12PanelLayout.createSequentialGroup()
.addContainerGap()
.addComponent(passwordPkcs12Label))
.addGroup(GroupLayout.Alignment.TRAILING, pkcs12PanelLayout.createSequentialGroup()
.addContainerGap(270, Short.MAX_VALUE)
.addComponent(addPkcs12Button))
.addGroup(pkcs12PanelLayout.createSequentialGroup()
.addContainerGap()
.addComponent(pkcs12PasswordField, GroupLayout.DEFAULT_SIZE, 369, Short.MAX_VALUE)))
.addContainerGap())
);
pkcs12PanelLayout.setVerticalGroup(
pkcs12PanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
.addGroup(GroupLayout.Alignment.TRAILING, pkcs12PanelLayout.createSequentialGroup()
.addComponent(fileLabel)
.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
.addGroup(pkcs12PanelLayout.createParallelGroup(GroupLayout.Alignment.BASELINE)
.addComponent(browseButton)
.addComponent(fileTextField, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
.addComponent(passwordPkcs12Label)
.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
.addComponent(pkcs12PasswordField, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
.addComponent(addPkcs12Button)
.addGap(70, 70, 70))
);
pkcs12PanelLayout.linkSize(SwingConstants.VERTICAL, new Component[] {addPkcs12Button, browseButton, fileTextField, pkcs12PasswordField});
certificatejTabbedPane.addTab("PKCS#12", pkcs12Panel);
driverLabel.setText("Driver");
driverButton.setText("...");
driverButton.setMargin(new Insets(2, 5, 2, 5));
driverButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent evt) {
driverButtonActionPerformed(evt);
}
});
passwordPkcs11Label.setText("PIN Code");
addPkcs11Button.setText("Add to keystore");
addPkcs11Button.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent evt) {
addPkcs11ButtonActionPerformed(evt);
}
});
GroupLayout pkcs11PanelLayout = new GroupLayout(pkcs11Panel);
pkcs11Panel.setLayout(pkcs11PanelLayout);
pkcs11PanelLayout.setHorizontalGroup(
pkcs11PanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
.addGroup(pkcs11PanelLayout.createSequentialGroup()
.addContainerGap()
.addGroup(pkcs11PanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
.addComponent(pkcs11PasswordField, GroupLayout.DEFAULT_SIZE, 369, Short.MAX_VALUE)
.addComponent(driverLabel)
.addComponent(passwordPkcs11Label)
.addGroup(pkcs11PanelLayout.createSequentialGroup()
.addComponent(driverComboBox, 0, 336, Short.MAX_VALUE)
.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
.addComponent(driverButton))
.addComponent(addPkcs11Button, GroupLayout.Alignment.TRAILING))
.addContainerGap())
);
pkcs11PanelLayout.setVerticalGroup(
pkcs11PanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
.addGroup(pkcs11PanelLayout.createSequentialGroup()
.addComponent(driverLabel)
.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
.addGroup(pkcs11PanelLayout.createParallelGroup(GroupLayout.Alignment.BASELINE)
.addComponent(driverButton)
.addComponent(driverComboBox, GroupLayout.PREFERRED_SIZE, 17, GroupLayout.PREFERRED_SIZE))
.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
.addComponent(passwordPkcs11Label)
.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
.addComponent(pkcs11PasswordField, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
.addComponent(addPkcs11Button)
.addGap(58, 58, 58))
);
pkcs11PanelLayout.linkSize(SwingConstants.VERTICAL, new Component[] {addPkcs11Button, driverButton, driverComboBox, pkcs11PasswordField});
certificatejTabbedPane.addTab("PKCS#11", pkcs11Panel);
GroupLayout cryptoApiPanelLayout = new GroupLayout(cryptoApiPanel);
cryptoApiPanel.setLayout(cryptoApiPanelLayout);
cryptoApiPanelLayout.setHorizontalGroup(
cryptoApiPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
.addGap(0, 389, Short.MAX_VALUE)
);
cryptoApiPanelLayout.setVerticalGroup(
cryptoApiPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
.addGap(0, 124, Short.MAX_VALUE)
);
certificatejTabbedPane.addTab("CrytoAPI", cryptoApiPanel);
useClientCertificateCheckBox.setText("Use client certificate");
useClientCertificateCheckBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
useClientCertificateCheckBox.setMargin(new Insets(0, 0, 0, 0));
useClientCertificateCheckBox.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent evt) {
useClientCertificateCheckBoxActionPerformed(evt);
}
});
textLabel.setText("<html><body><p> Add your keystore and select the desired certificate.</p>"
+ "<p>Certificate setting will not be stored in options and you will need to enable "
+ "certificate next time you restart Paros.</p></body></html>");
certificateLabel.setText("Active certificate");
certificateTextField.setEnabled(false);
showActiveCertificateButton.setText("->");
showActiveCertificateButton.setActionCommand(">");
showActiveCertificateButton.setEnabled(false);
showActiveCertificateButton.setMargin(new Insets(2, 2, 2, 2));
showActiveCertificateButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent evt) {
showActiveCertificateButtonActionPerformed(evt);
}
});
GroupLayout certificatePanelLayout = new GroupLayout(certificatePanel);
certificatePanel.setLayout(certificatePanelLayout);
certificatePanelLayout.setHorizontalGroup(
certificatePanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
.addGroup(certificatePanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
.addGroup(certificatePanelLayout.createSequentialGroup()
.addComponent(textLabel, 0, 0, Short.MAX_VALUE)
.addContainerGap())
.addGroup(certificatePanelLayout.createSequentialGroup()
.addGap(2, 2, 2)
.addGroup(certificatePanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
.addComponent(certificatejTabbedPane, GroupLayout.DEFAULT_SIZE, 394, Short.MAX_VALUE)
.addGroup(certificatePanelLayout.createSequentialGroup()
.addGroup(certificatePanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
.addComponent(useClientCertificateCheckBox)
.addComponent(certificateLabel)
.addGroup(GroupLayout.Alignment.TRAILING, certificatePanelLayout.createSequentialGroup()
.addComponent(certificateTextField, GroupLayout.DEFAULT_SIZE, 363, Short.MAX_VALUE)
.addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(showActiveCertificateButton)
.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)))
.addContainerGap()))))
);
certificatePanelLayout.setVerticalGroup(
certificatePanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
.addGroup(certificatePanelLayout.createSequentialGroup()
.addContainerGap()
.addComponent(textLabel)
.addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(useClientCertificateCheckBox)
.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
.addComponent(certificatejTabbedPane, GroupLayout.DEFAULT_SIZE, 152, Short.MAX_VALUE)
.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
.addComponent(certificateLabel)
.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
.addGroup(certificatePanelLayout.createParallelGroup(GroupLayout.Alignment.BASELINE)
.addComponent(certificateTextField, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
.addComponent(showActiveCertificateButton, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addContainerGap())
);
certificatePanelLayout.linkSize(SwingConstants.VERTICAL, new Component[] {certificateTextField, showActiveCertificateButton});
GroupLayout layout = new GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(GroupLayout.Alignment.LEADING)
.addComponent(certificatePanel, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
);
layout.setVerticalGroup(
layout.createParallelGroup(GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addComponent(certificatePanel, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addContainerGap())
);
pack();