Commits

Mark C committed 8331901

gui updates

  • Participants
  • Parent commits c8f0e23

Comments (0)

Files changed (29)

build/built-jar.properties

-#Wed, 26 Mar 2014 23:36:51 +1100
+#Wed, 09 Apr 2014 00:10:13 +1000
 
 
 /home/lp1/Desktop/Dropbox/Apps/clientcertificatemaker=

build/classes/KeyStore/Certificate.class

Binary file modified.

build/classes/KeyStore/KeyPair.class

Binary file modified.

build/classes/KeyStore/KeyStoreController.class

Binary file modified.

build/classes/KeyStoreGUI/CertificateFrame$1.class

Binary file added.

build/classes/KeyStoreGUI/CertificateFrame.class

Binary file added.

build/classes/KeyStoreGUI/CertificatePanel$1.class

Binary file added.

build/classes/KeyStoreGUI/CertificatePanel$2.class

Binary file added.

build/classes/KeyStoreGUI/CertificatePanel.class

Binary file added.

build/classes/KeyStoreGUI/CertificatePanel.form

+<?xml version="1.0" encoding="UTF-8" ?>
+
+<Form version="1.3" maxVersion="1.8" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
+  <AuxValues>
+    <AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/>
+    <AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
+    <AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/>
+    <AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/>
+    <AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/>
+    <AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/>
+    <AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
+    <AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
+    <AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
+  </AuxValues>
+
+  <Layout>
+    <DimensionLayout dim="0">
+      <Group type="103" groupAlignment="0" attributes="0">
+          <Group type="102" attributes="0">
+              <EmptySpace max="-2" attributes="0"/>
+              <Group type="103" groupAlignment="0" attributes="0">
+                  <Component id="jSeparator1" alignment="1" max="32767" attributes="0"/>
+                  <Component id="jScrollPane1" alignment="0" pref="553" max="32767" attributes="0"/>
+                  <Component id="jLabel1" alignment="0" max="32767" attributes="0"/>
+                  <Group type="102" attributes="0">
+                      <Group type="103" groupAlignment="0" attributes="0">
+                          <Component id="chooseCertFromFile" alignment="0" min="-2" max="-2" attributes="0"/>
+                          <Component id="createCertFile" alignment="0" min="-2" pref="218" max="-2" attributes="0"/>
+                      </Group>
+                      <EmptySpace min="0" pref="0" max="32767" attributes="0"/>
+                  </Group>
+              </Group>
+              <EmptySpace max="-2" attributes="0"/>
+          </Group>
+      </Group>
+    </DimensionLayout>
+    <DimensionLayout dim="1">
+      <Group type="103" groupAlignment="0" attributes="0">
+          <Group type="102" alignment="1" attributes="0">
+              <EmptySpace max="32767" attributes="0"/>
+              <Component id="chooseCertFromFile" min="-2" max="-2" attributes="0"/>
+              <EmptySpace min="-2" pref="7" max="-2" attributes="0"/>
+              <Component id="jSeparator1" min="-2" pref="5" max="-2" attributes="0"/>
+              <EmptySpace max="-2" attributes="0"/>
+              <Component id="jLabel1" min="-2" max="-2" attributes="0"/>
+              <EmptySpace max="-2" attributes="0"/>
+              <Component id="jScrollPane1" min="-2" pref="189" max="-2" attributes="0"/>
+              <EmptySpace max="-2" attributes="0"/>
+              <Component id="createCertFile" min="-2" max="-2" attributes="0"/>
+              <EmptySpace max="32767" attributes="0"/>
+          </Group>
+      </Group>
+    </DimensionLayout>
+  </Layout>
+  <SubComponents>
+    <Container class="javax.swing.JScrollPane" name="jScrollPane1">
+      <AuxValues>
+        <AuxValue name="autoScrollPane" type="java.lang.Boolean" value="true"/>
+      </AuxValues>
+
+      <Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
+      <SubComponents>
+        <Component class="javax.swing.JTextArea" name="textCertificateField">
+          <Properties>
+            <Property name="columns" type="int" value="20"/>
+            <Property name="rows" type="int" value="5"/>
+          </Properties>
+        </Component>
+      </SubComponents>
+    </Container>
+    <Component class="javax.swing.JLabel" name="jLabel1">
+      <Properties>
+        <Property name="text" type="java.lang.String" value="Enter certificate text:"/>
+      </Properties>
+    </Component>
+    <Component class="javax.swing.JButton" name="chooseCertFromFile">
+      <Properties>
+        <Property name="text" type="java.lang.String" value="Choose certificate from file"/>
+      </Properties>
+      <Events>
+        <EventHandler event="mouseReleased" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="chooseCertFromFileMouseReleased"/>
+        <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="chooseCertFromFileActionPerformed"/>
+      </Events>
+    </Component>
+    <Component class="javax.swing.JButton" name="createCertFile">
+      <Properties>
+        <Property name="text" type="java.lang.String" value="Generate brower certificate"/>
+      </Properties>
+    </Component>
+    <Component class="javax.swing.JSeparator" name="jSeparator1">
+    </Component>
+  </SubComponents>
+</Form>

build/classes/KeyStoreGUI/MainMenuPanel$1.class

Binary file modified.

build/classes/KeyStoreGUI/MainMenuPanel$2.class

Binary file modified.

build/classes/KeyStoreGUI/MainMenuPanel$3.class

Binary file modified.

build/classes/KeyStoreGUI/MainMenuPanel$4.class

Binary file modified.

build/classes/KeyStoreGUI/MainMenuPanel$5.class

Binary file modified.

build/classes/KeyStoreGUI/MainMenuPanel$6.class

Binary file added.

build/classes/KeyStoreGUI/MainMenuPanel.class

Binary file modified.

build/classes/KeyStoreGUI/MainMenuPanel.form

               <EmptySpace type="separate" max="-2" attributes="0"/>
               <Component id="jSeparator1" min="-2" max="-2" attributes="0"/>
               <EmptySpace type="separate" max="-2" attributes="0"/>
-              <Group type="103" groupAlignment="0" attributes="0">
-                  <Component id="jScrollPane2" min="-2" pref="470" max="-2" attributes="0"/>
-                  <Component id="openExistingButton" min="-2" pref="470" max="-2" attributes="0"/>
+              <Group type="103" groupAlignment="0" max="-2" attributes="0">
+                  <Component id="openExistingButton" pref="470" max="32767" attributes="0"/>
+                  <Component id="jScrollPane3" max="32767" attributes="0"/>
               </Group>
               <EmptySpace min="-2" pref="29" max="-2" attributes="0"/>
           </Group>
                           <Component id="openExistingButton" alignment="0" min="-2" max="-2" attributes="0"/>
                       </Group>
                       <EmptySpace max="-2" attributes="0"/>
-                      <Group type="103" groupAlignment="1" attributes="0">
-                          <Component id="jScrollPane1" min="-2" pref="243" max="-2" attributes="0"/>
-                          <Component id="jScrollPane2" min="-2" pref="243" max="-2" attributes="0"/>
+                      <Group type="103" groupAlignment="0" max="-2" attributes="0">
+                          <Component id="jScrollPane1" pref="243" max="32767" attributes="0"/>
+                          <Component id="jScrollPane3" max="32767" attributes="0"/>
                       </Group>
                   </Group>
               </Group>
         </Component>
       </SubComponents>
     </Container>
-    <Container class="javax.swing.JScrollPane" name="jScrollPane2">
+    <Component class="javax.swing.JSeparator" name="jSeparator1">
+      <Properties>
+        <Property name="orientation" type="int" value="1"/>
+      </Properties>
+    </Component>
+    <Container class="javax.swing.JScrollPane" name="jScrollPane3">
       <AuxValues>
         <AuxValue name="autoScrollPane" type="java.lang.Boolean" value="true"/>
       </AuxValues>
 
       <Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
       <SubComponents>
-        <Component class="javax.swing.JList" name="exitingKeyList">
+        <Component class="javax.swing.JList" name="fileListField">
           <Properties>
             <Property name="model" type="javax.swing.ListModel" editor="org.netbeans.modules.form.editors2.ListModelEditor">
               <StringArray count="5">
               </StringArray>
             </Property>
           </Properties>
+          <Events>
+            <EventHandler event="mouseReleased" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="fileListFieldMouseReleased"/>
+          </Events>
         </Component>
       </SubComponents>
     </Container>
-    <Component class="javax.swing.JSeparator" name="jSeparator1">
-      <Properties>
-        <Property name="orientation" type="int" value="1"/>
-      </Properties>
-    </Component>
   </SubComponents>
 </Form>

build/classes/PackageController.class

Binary file modified.

dist/KeystoreGUI.jar

Binary file modified.

src/KeyStore/Certificate.java

      * Default contructor
      * @ param String certPath specified cert to add
      */
-    public Certificate(String certPath, KeyPair existingKeyPair, String keyPassword) {
+    public Certificate(String certAbsPath, KeyPair existingKeyPair, String keyPassword) {
         PEMParser pemParser = null;
         try {
             keyPair = existingKeyPair;
             Certificate.keyPassword = keyPassword;
-            File certFile = new File(certPath);
+            File certFile = new File(certAbsPath);
             pemParser = new PEMParser(new FileReader(certFile));
             Object pemObject = pemParser.readObject();
             System.out.println(pemObject.toString());
     }
     
     
-    public void writePKCS12(String outputPath) {
+    public void writePKCS12(String outputAbsPath) {
         try {
             KeyStore ks = KeyStore.getInstance("PKCS12");
             ks.load(null, null);
                     keyPassword.toCharArray(), 
                     new java.security.cert.Certificate[]{x509Cert});
             
-            FileOutputStream fOut = new FileOutputStream(outputPath);
-            
+            FileOutputStream fOut = new FileOutputStream(outputAbsPath);
             ks.store(fOut, keyPassword.toCharArray());
         } catch (KeyStoreException ex) {
             Logger.getLogger(Certificate.class.getName()).log(Level.SEVERE, null, ex);

src/KeyStore/KeyPair.java

      * @param inPassword is input by user, default is 'abc123'
      * @param inFilePath refers to path of keypair
      */
-    public KeyPair(String keyPassword, String keyPath) throws FileNotFoundException, IOException {
-        File privateKeyFile = new File(keyPath);
+    public KeyPair(String keyPassword, String keyPath, String keyName) throws FileNotFoundException, IOException {
+        File privateKeyFile = new File(keyPath + File.separatorChar + keyName);
         PEMParser pemParser = new PEMParser(new FileReader(privateKeyFile));
         Object object = pemParser.readObject();
         PEMDecryptorProvider decProv = new JcePEMDecryptorProviderBuilder().build(keyPassword.toCharArray());

src/KeyStore/KeyStoreController.java

      * Key Constructor with filePath arg
      * 
      */
-    public KeyStoreController(String keyPassword, String keyName) throws FileNotFoundException, IOException {
+    public KeyStoreController(String keyPassword, String keyPath, String keyName) throws FileNotFoundException, IOException {
             // opens existing keypair assuming filename 'myKeyPair.pem' and path provided
-        KeyStoreController.keyPair = new KeyPair(keyPassword, keyName);
+        KeyStoreController.keyPair = new KeyPair(keyPassword, keyPath, keyName);
         KeyStoreController.keyPassword = keyPassword;
     }
 
-    public void setCert(String certPath) {
-            KeyStoreController.certificate = new Certificate(certPath, keyPair, keyPassword);
+    public void setCert(String certAbsPath) {
+            KeyStoreController.certificate = new Certificate(certAbsPath, keyPair, keyPassword);
     }
     
 
     //http://stackoverflow.com/questions/9711173/convert-ssl-pem-to-p12-with-or-without-openssl
-    public void exportPKCS12(String outputPath) {      
-        certificate.writePKCS12(outputPath);
+    public void exportPKCS12(String outputAbsPath) {      
+        certificate.writePKCS12(outputAbsPath);
     }
         
     public String getCSR(String x500Text) {

src/KeyStoreGUI/CertificateFrame.java

+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+
+package KeyStoreGUI;
+
+/**
+ *
+ * @author Mark Culhane
+ */
+/**
+ *
+ * @author Mark Culhane
+ */
+public class CertificateFrame extends javax.swing.JFrame {
+
+    /** Creates new form MainFrame */
+    public CertificateFrame() {
+        initComponents();
+    }
+
+    /** This method is called from within the constructor to
+     * initialize the form.
+     * WARNING: Do NOT modify this code. The content of this method is
+     * always regenerated by the Form Editor.
+     */
+    @SuppressWarnings("unchecked")
+    // <editor-fold defaultstate="collapsed" desc="Generated Code">                          
+    private void initComponents() {
+
+        certificateTabPanel = new javax.swing.JTabbedPane();
+
+        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
+        setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
+
+        certificateTabPanel.setSize(1024, 305);
+        certificateTabPanel.addTab("Client Certificate", new CertificatePanel());
+        
+        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
+        getContentPane().setLayout(layout);
+        layout.setHorizontalGroup(
+            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
+                .addContainerGap(1020, Short.MAX_VALUE)
+                .addContainerGap())
+            .addGroup(layout.createSequentialGroup()
+                .addContainerGap()
+                .addComponent(certificateTabPanel, javax.swing.GroupLayout.PREFERRED_SIZE, 1024, javax.swing.GroupLayout.PREFERRED_SIZE)
+                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
+        );
+        layout.setVerticalGroup(
+            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
+                .addContainerGap()
+                .addComponent(certificateTabPanel, javax.swing.GroupLayout.DEFAULT_SIZE, 360, Short.MAX_VALUE)
+                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+                .addContainerGap())
+        );
+
+        pack();
+        
+        
+    }// </editor-fold>                        
+
+    /**
+     * @param args the command line arguments
+     */
+    public static void main(String args[]) {
+        /* Set the Nimbus look and feel */
+        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
+        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
+         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
+         */
+        try {
+            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
+                if ("Nimbus".equals(info.getName())) {
+                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
+                    break;
+                }
+            }
+        } catch (ClassNotFoundException ex) {
+            java.util.logging.Logger.getLogger(CertificateFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
+        } catch (InstantiationException ex) {
+            java.util.logging.Logger.getLogger(CertificateFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
+        } catch (IllegalAccessException ex) {
+            java.util.logging.Logger.getLogger(CertificateFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
+        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
+            java.util.logging.Logger.getLogger(CertificateFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
+        }
+        //</editor-fold>
+
+        /* Create and display the form */
+        java.awt.EventQueue.invokeLater(new Runnable() {
+
+            @Override
+            public void run() {
+                new CertificateFrame().setVisible(true);
+            }
+        });
+    }
+    // Variables declaration - do not modify                     
+    private javax.swing.JTabbedPane certificateTabPanel;
+    // End of variables declaration                   
+}

src/KeyStoreGUI/CertificatePanel.form

+<?xml version="1.0" encoding="UTF-8" ?>
+
+<Form version="1.3" maxVersion="1.8" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
+  <AuxValues>
+    <AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/>
+    <AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
+    <AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/>
+    <AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/>
+    <AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/>
+    <AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/>
+    <AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
+    <AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
+    <AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
+  </AuxValues>
+
+  <Layout>
+    <DimensionLayout dim="0">
+      <Group type="103" groupAlignment="0" attributes="0">
+          <Group type="102" attributes="0">
+              <EmptySpace max="-2" attributes="0"/>
+              <Group type="103" groupAlignment="0" attributes="0">
+                  <Component id="jSeparator1" alignment="1" max="32767" attributes="0"/>
+                  <Component id="jScrollPane1" alignment="0" pref="553" max="32767" attributes="0"/>
+                  <Component id="jLabel1" alignment="0" max="32767" attributes="0"/>
+                  <Group type="102" attributes="0">
+                      <Group type="103" groupAlignment="0" attributes="0">
+                          <Component id="chooseCertFromFile" alignment="0" min="-2" max="-2" attributes="0"/>
+                          <Component id="createCertFile" alignment="0" min="-2" pref="218" max="-2" attributes="0"/>
+                      </Group>
+                      <EmptySpace min="0" pref="0" max="32767" attributes="0"/>
+                  </Group>
+              </Group>
+              <EmptySpace max="-2" attributes="0"/>
+          </Group>
+      </Group>
+    </DimensionLayout>
+    <DimensionLayout dim="1">
+      <Group type="103" groupAlignment="0" attributes="0">
+          <Group type="102" alignment="1" attributes="0">
+              <EmptySpace max="32767" attributes="0"/>
+              <Component id="chooseCertFromFile" min="-2" max="-2" attributes="0"/>
+              <EmptySpace min="-2" pref="7" max="-2" attributes="0"/>
+              <Component id="jSeparator1" min="-2" pref="5" max="-2" attributes="0"/>
+              <EmptySpace max="-2" attributes="0"/>
+              <Component id="jLabel1" min="-2" max="-2" attributes="0"/>
+              <EmptySpace max="-2" attributes="0"/>
+              <Component id="jScrollPane1" min="-2" pref="189" max="-2" attributes="0"/>
+              <EmptySpace max="-2" attributes="0"/>
+              <Component id="createCertFile" min="-2" max="-2" attributes="0"/>
+              <EmptySpace max="32767" attributes="0"/>
+          </Group>
+      </Group>
+    </DimensionLayout>
+  </Layout>
+  <SubComponents>
+    <Container class="javax.swing.JScrollPane" name="jScrollPane1">
+      <AuxValues>
+        <AuxValue name="autoScrollPane" type="java.lang.Boolean" value="true"/>
+      </AuxValues>
+
+      <Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
+      <SubComponents>
+        <Component class="javax.swing.JTextArea" name="textCertificateField">
+          <Properties>
+            <Property name="columns" type="int" value="20"/>
+            <Property name="rows" type="int" value="5"/>
+          </Properties>
+        </Component>
+      </SubComponents>
+    </Container>
+    <Component class="javax.swing.JLabel" name="jLabel1">
+      <Properties>
+        <Property name="text" type="java.lang.String" value="Enter certificate text:"/>
+      </Properties>
+    </Component>
+    <Component class="javax.swing.JButton" name="chooseCertFromFile">
+      <Properties>
+        <Property name="text" type="java.lang.String" value="Choose certificate from file"/>
+      </Properties>
+      <Events>
+        <EventHandler event="mouseReleased" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="chooseCertFromFileMouseReleased"/>
+        <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="chooseCertFromFileActionPerformed"/>
+      </Events>
+    </Component>
+    <Component class="javax.swing.JButton" name="createCertFile">
+      <Properties>
+        <Property name="text" type="java.lang.String" value="Generate brower certificate"/>
+      </Properties>
+    </Component>
+    <Component class="javax.swing.JSeparator" name="jSeparator1">
+    </Component>
+  </SubComponents>
+</Form>

src/KeyStoreGUI/CertificatePanel.java

+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package KeyStoreGUI;
+
+import javax.swing.JFileChooser;
+
+/**
+ *
+ * @author lp1
+ */
+public class CertificatePanel extends javax.swing.JPanel {
+
+    /**
+     * Creates new form Certificate
+     */
+    public CertificatePanel() {
+        initComponents();
+    }
+
+    /**
+     * This method is called from within the constructor to initialize the form.
+     * WARNING: Do NOT modify this code. The content of this method is always
+     * regenerated by the Form Editor.
+     */
+    @SuppressWarnings("unchecked")
+    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
+    private void initComponents() {
+
+        jScrollPane1 = new javax.swing.JScrollPane();
+        textCertificateField = new javax.swing.JTextArea();
+        jLabel1 = new javax.swing.JLabel();
+        chooseCertFromFile = new javax.swing.JButton();
+        createCertFile = new javax.swing.JButton();
+        jSeparator1 = new javax.swing.JSeparator();
+
+        textCertificateField.setColumns(20);
+        textCertificateField.setRows(5);
+        jScrollPane1.setViewportView(textCertificateField);
+
+        jLabel1.setText("Enter certificate text:");
+
+        chooseCertFromFile.setText("Choose certificate from file");
+        chooseCertFromFile.addMouseListener(new java.awt.event.MouseAdapter() {
+            public void mouseReleased(java.awt.event.MouseEvent evt) {
+                chooseCertFromFileMouseReleased(evt);
+            }
+        });
+        chooseCertFromFile.addActionListener(new java.awt.event.ActionListener() {
+            public void actionPerformed(java.awt.event.ActionEvent evt) {
+                chooseCertFromFileActionPerformed(evt);
+            }
+        });
+
+        createCertFile.setText("Generate brower certificate");
+
+        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
+        this.setLayout(layout);
+        layout.setHorizontalGroup(
+            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+            .addGroup(layout.createSequentialGroup()
+                .addContainerGap()
+                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+                    .addComponent(jSeparator1, javax.swing.GroupLayout.Alignment.TRAILING)
+                    .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 553, Short.MAX_VALUE)
+                    .addComponent(jLabel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
+                    .addGroup(layout.createSequentialGroup()
+                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+                            .addComponent(chooseCertFromFile)
+                            .addComponent(createCertFile, javax.swing.GroupLayout.PREFERRED_SIZE, 218, javax.swing.GroupLayout.PREFERRED_SIZE))
+                        .addGap(0, 0, Short.MAX_VALUE)))
+                .addContainerGap())
+        );
+        layout.setVerticalGroup(
+            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
+                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
+                .addComponent(chooseCertFromFile)
+                .addGap(7, 7, 7)
+                .addComponent(jSeparator1, javax.swing.GroupLayout.PREFERRED_SIZE, 5, javax.swing.GroupLayout.PREFERRED_SIZE)
+                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+                .addComponent(jLabel1)
+                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+                .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 189, javax.swing.GroupLayout.PREFERRED_SIZE)
+                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+                .addComponent(createCertFile)
+                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
+        );
+    }// </editor-fold>//GEN-END:initComponents
+
+    private void chooseCertFromFileActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_chooseCertFromFileActionPerformed
+        // TODO add your handling code here:
+    }//GEN-LAST:event_chooseCertFromFileActionPerformed
+
+    private void chooseCertFromFileMouseReleased(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_chooseCertFromFileMouseReleased
+        // open file selector dialogue
+        JFileChooser chooser = new JFileChooser();
+        //FileNameExtensionFilter filter = new FileNameExtensionFilter(
+        //"JPG & GIF Images", "jpg", "gif");
+        //chooser.setFileFilter(filter);
+        int returnVal;
+        returnVal = chooser.showOpenDialog(this);
+        if(returnVal == JFileChooser.APPROVE_OPTION) {
+            certAbsolutePath = chooser.getSelectedFile().getAbsolutePath();
+            System.out.println("You chose to open this file: " +
+            certAbsolutePath);
+            
+        }
+           
+        this.setVisible(false);
+    }//GEN-LAST:event_chooseCertFromFileMouseReleased
+
+    public String getCertPath() {
+        return certAbsolutePath;
+    }
+    
+    // Variables declaration - do not modify//GEN-BEGIN:variables
+    private javax.swing.JButton chooseCertFromFile;
+    private javax.swing.JButton createCertFile;
+    private javax.swing.JLabel jLabel1;
+    private javax.swing.JScrollPane jScrollPane1;
+    private javax.swing.JSeparator jSeparator1;
+    private javax.swing.JTextArea textCertificateField;
+    // End of variables declaration//GEN-END:variables
+    private String certAbsolutePath;
+}

src/KeyStoreGUI/MainMenuPanel.form

               <EmptySpace type="separate" max="-2" attributes="0"/>
               <Component id="jSeparator1" min="-2" max="-2" attributes="0"/>
               <EmptySpace type="separate" max="-2" attributes="0"/>
-              <Group type="103" groupAlignment="0" attributes="0">
-                  <Component id="jScrollPane2" min="-2" pref="470" max="-2" attributes="0"/>
-                  <Component id="openExistingButton" min="-2" pref="470" max="-2" attributes="0"/>
+              <Group type="103" groupAlignment="0" max="-2" attributes="0">
+                  <Component id="openExistingButton" pref="470" max="32767" attributes="0"/>
+                  <Component id="jScrollPane3" max="32767" attributes="0"/>
               </Group>
               <EmptySpace min="-2" pref="29" max="-2" attributes="0"/>
           </Group>
                           <Component id="openExistingButton" alignment="0" min="-2" max="-2" attributes="0"/>
                       </Group>
                       <EmptySpace max="-2" attributes="0"/>
-                      <Group type="103" groupAlignment="1" attributes="0">
-                          <Component id="jScrollPane1" min="-2" pref="243" max="-2" attributes="0"/>
-                          <Component id="jScrollPane2" min="-2" pref="243" max="-2" attributes="0"/>
+                      <Group type="103" groupAlignment="0" max="-2" attributes="0">
+                          <Component id="jScrollPane1" pref="243" max="32767" attributes="0"/>
+                          <Component id="jScrollPane3" max="32767" attributes="0"/>
                       </Group>
                   </Group>
               </Group>
         </Component>
       </SubComponents>
     </Container>
-    <Container class="javax.swing.JScrollPane" name="jScrollPane2">
+    <Component class="javax.swing.JSeparator" name="jSeparator1">
+      <Properties>
+        <Property name="orientation" type="int" value="1"/>
+      </Properties>
+    </Component>
+    <Container class="javax.swing.JScrollPane" name="jScrollPane3">
       <AuxValues>
         <AuxValue name="autoScrollPane" type="java.lang.Boolean" value="true"/>
       </AuxValues>
 
       <Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
       <SubComponents>
-        <Component class="javax.swing.JList" name="exitingKeyList">
+        <Component class="javax.swing.JList" name="fileListField">
           <Properties>
             <Property name="model" type="javax.swing.ListModel" editor="org.netbeans.modules.form.editors2.ListModelEditor">
               <StringArray count="5">
               </StringArray>
             </Property>
           </Properties>
+          <Events>
+            <EventHandler event="mouseReleased" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="fileListFieldMouseReleased"/>
+          </Events>
         </Component>
       </SubComponents>
     </Container>
-    <Component class="javax.swing.JSeparator" name="jSeparator1">
-      <Properties>
-        <Property name="orientation" type="int" value="1"/>
-      </Properties>
-    </Component>
   </SubComponents>
 </Form>

src/KeyStoreGUI/MainMenuPanel.java

  */
 package KeyStoreGUI;
 
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.util.logging.Level;
+import java.util.logging.Logger;
 import javax.swing.Box;
+import javax.swing.DefaultListModel;
+import javax.swing.JFileChooser;
+import javax.swing.JFrame;
 import javax.swing.JLabel;
 import javax.swing.JOptionPane;
 import javax.swing.JPasswordField;
+import javax.swing.ListModel;
 
 /**
  *
 public class MainMenuPanel extends javax.swing.JPanel {
     private static Integer bitLength = 2048;
     private static String outputDir = "output";
+    private DefaultListModel filesInDirectory = new DefaultListModel();
+    
     /**
      * Creates new form KeyPanel
      */
     public MainMenuPanel() {
         initComponents();
         //Insert code for including a list of pemkeys
+        File folder = new File(outputDir);
         
+        fileListField.setModel((ListModel) listFilesForDir(folder));
+    }
+    
+    //Populate list
+    private DefaultListModel listFilesForDir( final File folder) {
+            Integer i = 0;
+            for (final File fileEntry : folder.listFiles()) {
+                System.out.println(fileEntry.getName());
+                if (fileEntry.isDirectory()) {  
+                    listFilesForDir(fileEntry);
+                } else {
+                        if(fileEntry.getName().toUpperCase().endsWith(".KEY.PEM")){
+                            filesInDirectory.add(i,fileEntry.getName());
+                            i++;
+                        }
+                       }
+        }
+    return filesInDirectory;
     }
     
     private static String getPassword(String message) {
         openExistingButton = new javax.swing.JToggleButton();
         jScrollPane1 = new javax.swing.JScrollPane();
         csrTextField = new javax.swing.JTextArea();
-        jScrollPane2 = new javax.swing.JScrollPane();
-        exitingKeyList = new javax.swing.JList();
         jSeparator1 = new javax.swing.JSeparator();
+        jScrollPane3 = new javax.swing.JScrollPane();
+        fileListField = new javax.swing.JList();
 
         setMinimumSize(new java.awt.Dimension(1023, 305));
         setPreferredSize(new java.awt.Dimension(1024, 305));
         });
         jScrollPane1.setViewportView(csrTextField);
 
-        exitingKeyList.setModel(new javax.swing.AbstractListModel() {
+        jSeparator1.setOrientation(javax.swing.SwingConstants.VERTICAL);
+
+        fileListField.setModel(new javax.swing.AbstractListModel() {
             String[] strings = { "Item 1", "Item 2", "Item 3", "Item 4", "Item 5" };
             public int getSize() { return strings.length; }
             public Object getElementAt(int i) { return strings[i]; }
         });
-        jScrollPane2.setViewportView(exitingKeyList);
-
-        jSeparator1.setOrientation(javax.swing.SwingConstants.VERTICAL);
+        fileListField.addMouseListener(new java.awt.event.MouseAdapter() {
+            public void mouseReleased(java.awt.event.MouseEvent evt) {
+                fileListFieldMouseReleased(evt);
+            }
+        });
+        jScrollPane3.setViewportView(fileListField);
 
         javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
         this.setLayout(layout);
                 .addGap(18, 18, 18)
                 .addComponent(jSeparator1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                 .addGap(18, 18, 18)
-                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
-                    .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 470, javax.swing.GroupLayout.PREFERRED_SIZE)
-                    .addComponent(openExistingButton, javax.swing.GroupLayout.PREFERRED_SIZE, 470, javax.swing.GroupLayout.PREFERRED_SIZE))
+                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
+                    .addComponent(openExistingButton, javax.swing.GroupLayout.DEFAULT_SIZE, 470, Short.MAX_VALUE)
+                    .addComponent(jScrollPane3))
                 .addGap(29, 29, 29))
         );
         layout.setVerticalGroup(
                             .addComponent(generateNewButton)
                             .addComponent(openExistingButton))
                         .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
-                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
-                            .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 243, javax.swing.GroupLayout.PREFERRED_SIZE)
-                            .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 243, javax.swing.GroupLayout.PREFERRED_SIZE))))
+                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
+                            .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 243, Short.MAX_VALUE)
+                            .addComponent(jScrollPane3))))
                 .addContainerGap(14, Short.MAX_VALUE))
         );
     }// </editor-fold>//GEN-END:initComponents
     }//GEN-LAST:event_csrTextFieldMouseClicked
 
     private void openExistingButtonMouseReleased(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_openExistingButtonMouseReleased
+        KeyStore.KeyStoreController openKeySess = null;
+        String certAbsolutePath = null;
+        String exportAbsPath = null;
+        try {
+            String keyPassword = getPassword("Enter new key password: ");
+            openKeySess = new KeyStore.KeyStoreController(keyPassword, outputDir, fileListField.getSelectedValue().toString());
+        } catch (FileNotFoundException ex) {
+            Logger.getLogger(MainMenuPanel.class.getName()).log(Level.SEVERE, null, ex);
+        } catch (IOException ex) {
+            Logger.getLogger(MainMenuPanel.class.getName()).log(Level.SEVERE, null, ex);
+        }
+        //Enter/Select certificate
+
+        JFileChooser chooser = new JFileChooser();
+        int returnVal, returnVal2;
+        chooser.setCurrentDirectory(new File(outputDir));
+        returnVal = chooser.showOpenDialog(this);
+        if(returnVal == JFileChooser.APPROVE_OPTION) {
+            certAbsolutePath = chooser.getSelectedFile().getAbsolutePath();          
+        }
+        openKeySess.setCert(certAbsolutePath);
+        
+        returnVal2 = chooser.showSaveDialog(this);
+        if(returnVal2 == JFileChooser.APPROVE_OPTION) {
+            certAbsolutePath = chooser.getSelectedFile().getAbsolutePath();
+        }
         
+        openKeySess.exportPKCS12(exportAbsPath);
+        JOptionPane.showMessageDialog(null, "PKCS12 certificate writen to " + exportAbsPath +
+                "/n Double click on file to install");
     }//GEN-LAST:event_openExistingButtonMouseReleased
 
     private void openExistingButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_openExistingButtonActionPerformed
         // TODO add your handling code here:
     }//GEN-LAST:event_openExistingButtonActionPerformed
 
+    private void fileListFieldMouseReleased(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_fileListFieldMouseReleased
+        
+        
+    }//GEN-LAST:event_fileListFieldMouseReleased
+
     // Variables declaration - do not modify//GEN-BEGIN:variables
     private javax.swing.JTextArea csrTextField;
-    private javax.swing.JList exitingKeyList;
+    private javax.swing.JList fileListField;
     private javax.swing.JButton generateNewButton;
     private javax.swing.JScrollPane jScrollPane1;
-    private javax.swing.JScrollPane jScrollPane2;
+    private javax.swing.JScrollPane jScrollPane3;
     private javax.swing.JSeparator jSeparator1;
     private javax.swing.JToggleButton openExistingButton;
     // End of variables declaration//GEN-END:variables

src/PackageController.java

 public class PackageController {
  
     public static void main(String[] args) {
-        JFrame newFrame = new MainFrame();
-        newFrame.setTitle("Simple Client SSL tool");
-        newFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
-        newFrame.setVisible(true);
+        JFrame mainMenuFrame = new MainFrame();
+        mainMenuFrame.setTitle("Simple Client SSL tool");
+        mainMenuFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
+        mainMenuFrame.setVisible(true);
     }   
-//    public static void main(String[] args) throws IOException {
-//                //default keystore controller contructer
-//
-//                Scanner sc = new Scanner(System.in);
-//                int i = 9;
-//                do {
-//                    do {
-//                        System.out.println("##################### "
-//                            + "\n 0 - Exit"
-//                            + "\n 1 - Generate New Key and CSR"
-//                            + "\n 2 - Create pfx from existing keypair and certificate"
-//                            + "\n Enter option number:");
-//                        i = sc.nextInt();
-//                    } while (i > 2);
-//                    if (i == 1) newKeyAndCSR();
-//                    if (i == 2) {
-//                        createPFX(certPath);
-//                    }
-//                } while (i != 0);
-//                System.exit(0);
-//        } 
-//    
-//    private static void newKeyAndCSR() throws FileNotFoundException, IOException {
-//        KeyStoreController keyStoreController = new KeyStoreController(2048, keyPassword, keyPath);
-//        System.out.println(keyStoreController.getCSR(x500Text));
-//    }
-//    
-//    private static void createPFX(String certPath) throws FileNotFoundException, IOException {
-//        KeyStoreController keyStoreController = new KeyStoreController(keyPassword, keyPath);
-//        keyStoreController.setCert(certPath);
-//        keyStoreController.exportPKCS12(outputPath);
-//        System.out.println("... Done :D");
-//    }
 }