| | |
| | | private JLabel lKeystoreType; |
| | | private JRadioButton rbPKCS11; |
| | | private JRadioButton rbJKS; |
| | | private JRadioButton rbJCEKS; |
| | | private JRadioButton rbPKCS12; |
| | | private JLabel lKeystorePath; |
| | | private JTextField tfKeystorePath; |
| | |
| | | String.valueOf(tfKeystorePwd.getPassword()), enableSSL, |
| | | enableStartTLS, sslPort, selectedAlias); |
| | | } |
| | | else if (rbJCEKS.isSelected()) |
| | | { |
| | | ops = SecurityOptions.createJCEKSCertificateOptions( |
| | | tfKeystorePath.getText(), |
| | | String.valueOf(tfKeystorePwd.getPassword()), enableSSL, |
| | | enableStartTLS, sslPort, selectedAlias); |
| | | } |
| | | else if (rbPKCS11.isSelected()) |
| | | { |
| | | ops = SecurityOptions.createPKCS11CertificateOptions( |
| | |
| | | INFO_JKS_CERTIFICATE_TOOLTIP.get(), |
| | | UIFactory.TextStyle.SECONDARY_FIELD_VALID); |
| | | rbJKS.addActionListener(l); |
| | | rbJCEKS = UIFactory.makeJRadioButton( |
| | | INFO_JCEKS_CERTIFICATE_LABEL.get(), |
| | | INFO_JCEKS_CERTIFICATE_TOOLTIP.get(), |
| | | UIFactory.TextStyle.SECONDARY_FIELD_VALID); |
| | | rbJCEKS.addActionListener(l); |
| | | rbPKCS11 = UIFactory.makeJRadioButton( |
| | | INFO_PKCS11_CERTIFICATE_LABEL.get(), |
| | | INFO_PKCS11_CERTIFICATE_TOOLTIP.get(), |
| | |
| | | rbPKCS12.addActionListener(l); |
| | | ButtonGroup group2 = new ButtonGroup(); |
| | | group2.add(rbJKS); |
| | | group2.add(rbJCEKS); |
| | | group2.add(rbPKCS11); |
| | | group2.add(rbPKCS12); |
| | | lKeystoreType.setLabelFor(rbJKS); |
| | |
| | | gbc.gridwidth = GridBagConstraints.RELATIVE; |
| | | aux2Panel.add(Box.createHorizontalGlue(), gbc); |
| | | gbc.gridwidth = GridBagConstraints.REMAINDER; |
| | | aux2Panel.add(rbJCEKS, gbc); |
| | | gbc.gridwidth = GridBagConstraints.RELATIVE; |
| | | aux2Panel.add(Box.createHorizontalGlue(), gbc); |
| | | gbc.gridwidth = GridBagConstraints.REMAINDER; |
| | | aux2Panel.add(rbPKCS12, gbc); |
| | | gbc.gridwidth = GridBagConstraints.RELATIVE; |
| | | aux2Panel.add(Box.createHorizontalGlue(), gbc); |
| | |
| | | tfKeystorePwd.setText(securityOptions.getKeystorePassword()); |
| | | break; |
| | | |
| | | case JCEKS: |
| | | rbUseExistingCertificate.setSelected(true); |
| | | rbJCEKS.setSelected(true); |
| | | tfKeystorePath.setText(securityOptions.getKeystorePath()); |
| | | tfKeystorePwd.setText(securityOptions.getKeystorePassword()); |
| | | break; |
| | | |
| | | case PKCS11: |
| | | rbUseExistingCertificate.setSelected(true); |
| | | rbPKCS11.setSelected(true); |
| | |
| | | } |
| | | |
| | | if (useSSL && rbUseExistingCertificate.isSelected() && |
| | | !rbJKS.isSelected() && !rbPKCS11.isSelected() && !rbPKCS12.isSelected()) |
| | | !rbJKS.isSelected() && !rbJCEKS.isSelected() && |
| | | !rbPKCS11.isSelected() && !rbPKCS12.isSelected()) |
| | | { |
| | | rbJKS.setSelected(true); |
| | | } |
| | |
| | | lKeystoreType.setEnabled( |
| | | rbUseExistingCertificate.isSelected() && useSSL); |
| | | rbJKS.setEnabled(rbUseExistingCertificate.isSelected() && useSSL); |
| | | rbJCEKS.setEnabled(rbUseExistingCertificate.isSelected() && useSSL); |
| | | rbPKCS11.setEnabled(rbUseExistingCertificate.isSelected() && useSSL); |
| | | rbPKCS12.setEnabled(rbUseExistingCertificate.isSelected() && useSSL); |
| | | |
| | |
| | | (cbEnableSSL.isSelected() || cbEnableStartTLS.isSelected())) |
| | | { |
| | | String path = tfKeystorePath.getText(); |
| | | if (rbJKS.isSelected() || rbPKCS12.isSelected()) |
| | | if (rbJKS.isSelected() || rbJCEKS.isSelected() || rbPKCS12.isSelected()) |
| | | { |
| | | /* Check the path */ |
| | | if ((path == null) || (path.length() == 0)) |
| | |
| | | CertificateManager.KEY_STORE_TYPE_JKS, |
| | | pwd); |
| | | } |
| | | else if (rbJCEKS.isSelected()) |
| | | { |
| | | certManager = new CertificateManager( |
| | | path, |
| | | CertificateManager.KEY_STORE_TYPE_JCEKS, |
| | | pwd); |
| | | } |
| | | else if (rbPKCS12.isSelected()) |
| | | { |
| | | certManager = new CertificateManager( |
| | |
| | | { |
| | | errorMsgs.add(INFO_JKS_KEYSTORE_DOES_NOT_EXIST.get()); |
| | | } |
| | | else if (rbJCEKS.isSelected()) |
| | | { |
| | | errorMsgs.add(INFO_JCEKS_KEYSTORE_DOES_NOT_EXIST.get()); |
| | | } |
| | | else |
| | | { |
| | | errorMsgs.add(INFO_PKCS12_KEYSTORE_DOES_NOT_EXIST.get()); |
| | |
| | | { |
| | | errorMsgs.add(INFO_ERROR_ACCESSING_JKS_KEYSTORE.get()); |
| | | } |
| | | else if (rbJCEKS.isSelected()) |
| | | { |
| | | errorMsgs.add(INFO_ERROR_ACCESSING_JCEKS_KEYSTORE.get()); |
| | | } |
| | | else |
| | | { |
| | | errorMsgs.add(INFO_ERROR_ACCESSING_PKCS12_KEYSTORE.get()); |