Search in sources :

Example 1 with JKeyIdentifier

use of org.kse.gui.crypto.JKeyIdentifier in project keystore-explorer by kaikramer.

the class DAuthorityKeyIdentifier method initComponents.

private void initComponents() {
    jlKeyIdentifier = new JLabel(res.getString("DAuthorityKeyIdentifier.jlKeyIdentifer.text"));
    GridBagConstraints gbc_jlKeyIdentifier = new GridBagConstraints();
    gbc_jlKeyIdentifier.gridx = 0;
    gbc_jlKeyIdentifier.gridy = 0;
    gbc_jlKeyIdentifier.gridwidth = 1;
    gbc_jlKeyIdentifier.gridheight = 1;
    gbc_jlKeyIdentifier.insets = new Insets(5, 5, 5, 5);
    gbc_jlKeyIdentifier.anchor = GridBagConstraints.EAST;
    jkiKeyIdentifier = new JKeyIdentifier(res.getString("DAuthorityKeyIdentifier.KeyIdentifier.Title"), authorityPublicKey);
    GridBagConstraints gbc_jkiKeyIdentifier = new GridBagConstraints();
    gbc_jkiKeyIdentifier.gridx = 1;
    gbc_jkiKeyIdentifier.gridy = 0;
    gbc_jkiKeyIdentifier.gridwidth = 1;
    gbc_jkiKeyIdentifier.gridheight = 1;
    gbc_jkiKeyIdentifier.insets = new Insets(5, 5, 5, 5);
    gbc_jkiKeyIdentifier.anchor = GridBagConstraints.WEST;
    jlAuthorityCertIssuer = new JLabel(res.getString("DAuthorityKeyIdentifier.jlAuthorityCertIssuer.text"));
    GridBagConstraints gbc_jlAuthorityCertIssuer = new GridBagConstraints();
    gbc_jlAuthorityCertIssuer.gridx = 0;
    gbc_jlAuthorityCertIssuer.gridy = 1;
    gbc_jlAuthorityCertIssuer.gridwidth = 1;
    gbc_jlAuthorityCertIssuer.gridheight = 1;
    gbc_jlAuthorityCertIssuer.insets = new Insets(0, 5, 0, 5);
    gbc_jlAuthorityCertIssuer.anchor = GridBagConstraints.NORTHEAST;
    jgnAuthorityCertIssuer = new JGeneralNames(res.getString("DAuthorityKeyIdentifier.AuthorityCertIssuer.Title"));
    jgnAuthorityCertIssuer.setPreferredSize(new Dimension(400, 150));
    GridBagConstraints gbc_jgnAuthorityCertIssuer = new GridBagConstraints();
    gbc_jgnAuthorityCertIssuer.gridx = 1;
    gbc_jgnAuthorityCertIssuer.gridy = 1;
    gbc_jgnAuthorityCertIssuer.gridwidth = 1;
    gbc_jgnAuthorityCertIssuer.gridheight = 1;
    gbc_jgnAuthorityCertIssuer.insets = new Insets(0, 5, 0, 5);
    gbc_jgnAuthorityCertIssuer.anchor = GridBagConstraints.WEST;
    jlAuthorityCertSerialNumber = new JLabel(res.getString("DAuthorityKeyIdentifier.jlAuthorityCertSerialNumber.text"));
    GridBagConstraints gbc_jlAuthorityCertSerialNumber = new GridBagConstraints();
    gbc_jlAuthorityCertSerialNumber.gridx = 0;
    gbc_jlAuthorityCertSerialNumber.gridy = 2;
    gbc_jlAuthorityCertSerialNumber.gridwidth = 1;
    gbc_jlAuthorityCertSerialNumber.gridheight = 1;
    gbc_jlAuthorityCertSerialNumber.insets = new Insets(5, 5, 5, 5);
    gbc_jlAuthorityCertSerialNumber.anchor = GridBagConstraints.EAST;
    jtfAuthorityCertSerialNumber = new JTextField(20);
    GridBagConstraints gbc_jtfAuthorityCertSerialNumber = new GridBagConstraints();
    gbc_jtfAuthorityCertSerialNumber.gridx = 1;
    gbc_jtfAuthorityCertSerialNumber.gridy = 2;
    gbc_jtfAuthorityCertSerialNumber.gridwidth = 1;
    gbc_jtfAuthorityCertSerialNumber.gridheight = 1;
    gbc_jtfAuthorityCertSerialNumber.insets = new Insets(5, 5, 5, 5);
    gbc_jtfAuthorityCertSerialNumber.anchor = GridBagConstraints.WEST;
    jpAuthorityKeyIdentifier = new JPanel(new GridBagLayout());
    jpAuthorityKeyIdentifier.setBorder(new CompoundBorder(new EmptyBorder(5, 5, 5, 5), new EtchedBorder()));
    jpAuthorityKeyIdentifier.add(jlKeyIdentifier, gbc_jlKeyIdentifier);
    jpAuthorityKeyIdentifier.add(jkiKeyIdentifier, gbc_jkiKeyIdentifier);
    jpAuthorityKeyIdentifier.add(jlAuthorityCertIssuer, gbc_jlAuthorityCertIssuer);
    jpAuthorityKeyIdentifier.add(jgnAuthorityCertIssuer, gbc_jgnAuthorityCertIssuer);
    jpAuthorityKeyIdentifier.add(jlAuthorityCertSerialNumber, gbc_jlAuthorityCertSerialNumber);
    jpAuthorityKeyIdentifier.add(jtfAuthorityCertSerialNumber, gbc_jtfAuthorityCertSerialNumber);
    jbOK = new JButton(res.getString("DAuthorityKeyIdentifier.jbOK.text"));
    jbOK.addActionListener(new ActionListener() {

        @Override
        public void actionPerformed(ActionEvent evt) {
            okPressed();
        }
    });
    jbCancel = new JButton(res.getString("DAuthorityKeyIdentifier.jbCancel.text"));
    jbCancel.addActionListener(new ActionListener() {

        @Override
        public void actionPerformed(ActionEvent evt) {
            cancelPressed();
        }
    });
    jbCancel.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0), CANCEL_KEY);
    jbCancel.getActionMap().put(CANCEL_KEY, new AbstractAction() {

        private static final long serialVersionUID = 1L;

        @Override
        public void actionPerformed(ActionEvent evt) {
            cancelPressed();
        }
    });
    jpButtons = PlatformUtil.createDialogButtonPanel(jbOK, jbCancel, false);
    getContentPane().setLayout(new BorderLayout());
    getContentPane().add(jpAuthorityKeyIdentifier, BorderLayout.CENTER);
    getContentPane().add(jpButtons, BorderLayout.SOUTH);
    addWindowListener(new WindowAdapter() {

        @Override
        public void windowClosing(WindowEvent evt) {
            closeDialog();
        }
    });
    setResizable(false);
    getRootPane().setDefaultButton(jbOK);
    pack();
}
Also used : JPanel(javax.swing.JPanel) GridBagConstraints(java.awt.GridBagConstraints) Insets(java.awt.Insets) GridBagLayout(java.awt.GridBagLayout) ActionEvent(java.awt.event.ActionEvent) JButton(javax.swing.JButton) JLabel(javax.swing.JLabel) WindowAdapter(java.awt.event.WindowAdapter) Dimension(java.awt.Dimension) JTextField(javax.swing.JTextField) EtchedBorder(javax.swing.border.EtchedBorder) ActionListener(java.awt.event.ActionListener) BorderLayout(java.awt.BorderLayout) JKeyIdentifier(org.kse.gui.crypto.JKeyIdentifier) WindowEvent(java.awt.event.WindowEvent) CompoundBorder(javax.swing.border.CompoundBorder) EmptyBorder(javax.swing.border.EmptyBorder) AbstractAction(javax.swing.AbstractAction) JGeneralNames(org.kse.gui.crypto.generalname.JGeneralNames)

Example 2 with JKeyIdentifier

use of org.kse.gui.crypto.JKeyIdentifier in project keystore-explorer by kaikramer.

the class DSubjectKeyIdentifier method initComponents.

private void initComponents() {
    jlKeyIdentifier = new JLabel(res.getString("DSubjectKeyIdentifier.jlKeyIdentifer.text"));
    jkiKeyIdentifier = new JKeyIdentifier(res.getString("DSubjectKeyIdentifier.KeyIdentifier.Title"), subjectPublicKey);
    jpSubjectKeyIdentifier = new JPanel(new BorderLayout(5, 5));
    jpSubjectKeyIdentifier.setBorder(new CompoundBorder(new EmptyBorder(5, 5, 5, 5), new CompoundBorder(new EtchedBorder(), new EmptyBorder(5, 5, 5, 5))));
    jpSubjectKeyIdentifier.add(jlKeyIdentifier, BorderLayout.WEST);
    jpSubjectKeyIdentifier.add(jkiKeyIdentifier, BorderLayout.CENTER);
    jbOK = new JButton(res.getString("DSubjectKeyIdentifier.jbOK.text"));
    jbOK.addActionListener(new ActionListener() {

        @Override
        public void actionPerformed(ActionEvent evt) {
            okPressed();
        }
    });
    jbCancel = new JButton(res.getString("DSubjectKeyIdentifier.jbCancel.text"));
    jbCancel.addActionListener(new ActionListener() {

        @Override
        public void actionPerformed(ActionEvent evt) {
            cancelPressed();
        }
    });
    jbCancel.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0), CANCEL_KEY);
    jbCancel.getActionMap().put(CANCEL_KEY, new AbstractAction() {

        private static final long serialVersionUID = 1L;

        @Override
        public void actionPerformed(ActionEvent evt) {
            cancelPressed();
        }
    });
    jpButtons = PlatformUtil.createDialogButtonPanel(jbOK, jbCancel, false);
    getContentPane().setLayout(new BorderLayout());
    getContentPane().add(jpSubjectKeyIdentifier, BorderLayout.CENTER);
    getContentPane().add(jpButtons, BorderLayout.SOUTH);
    addWindowListener(new WindowAdapter() {

        @Override
        public void windowClosing(WindowEvent evt) {
            closeDialog();
        }
    });
    setResizable(false);
    getRootPane().setDefaultButton(jbOK);
    pack();
}
Also used : JPanel(javax.swing.JPanel) ActionEvent(java.awt.event.ActionEvent) JButton(javax.swing.JButton) JLabel(javax.swing.JLabel) WindowAdapter(java.awt.event.WindowAdapter) EtchedBorder(javax.swing.border.EtchedBorder) BorderLayout(java.awt.BorderLayout) ActionListener(java.awt.event.ActionListener) JKeyIdentifier(org.kse.gui.crypto.JKeyIdentifier) WindowEvent(java.awt.event.WindowEvent) CompoundBorder(javax.swing.border.CompoundBorder) EmptyBorder(javax.swing.border.EmptyBorder) AbstractAction(javax.swing.AbstractAction)

Aggregations

BorderLayout (java.awt.BorderLayout)2 ActionEvent (java.awt.event.ActionEvent)2 ActionListener (java.awt.event.ActionListener)2 WindowAdapter (java.awt.event.WindowAdapter)2 WindowEvent (java.awt.event.WindowEvent)2 AbstractAction (javax.swing.AbstractAction)2 JButton (javax.swing.JButton)2 JLabel (javax.swing.JLabel)2 JPanel (javax.swing.JPanel)2 CompoundBorder (javax.swing.border.CompoundBorder)2 EmptyBorder (javax.swing.border.EmptyBorder)2 EtchedBorder (javax.swing.border.EtchedBorder)2 JKeyIdentifier (org.kse.gui.crypto.JKeyIdentifier)2 Dimension (java.awt.Dimension)1 GridBagConstraints (java.awt.GridBagConstraints)1 GridBagLayout (java.awt.GridBagLayout)1 Insets (java.awt.Insets)1 JTextField (javax.swing.JTextField)1 JGeneralNames (org.kse.gui.crypto.generalname.JGeneralNames)1