From cca539a060ac6f7216304a54aa1d2b7a64ce5797 Mon Sep 17 00:00:00 2001
From: jvergara <jvergara@localhost>
Date: Sun, 05 Aug 2007 11:19:47 +0000
Subject: [PATCH] Fix for issue 2059.

---
 opends/src/quicksetup/org/opends/quicksetup/ui/CertificateDialog.java |   38 +++++++++++++++++++++++++-------------
 1 files changed, 25 insertions(+), 13 deletions(-)

diff --git a/opends/src/quicksetup/org/opends/quicksetup/ui/CertificateDialog.java b/opends/src/quicksetup/org/opends/quicksetup/ui/CertificateDialog.java
index e7ab611..02d99b8 100644
--- a/opends/src/quicksetup/org/opends/quicksetup/ui/CertificateDialog.java
+++ b/opends/src/quicksetup/org/opends/quicksetup/ui/CertificateDialog.java
@@ -205,7 +205,8 @@
         certificateDetails.getPreferredSize().width), gbc);
     gbc.insets.top = 0;
     gbc.weighty = 1.0;
-    JPanel auxPanel = new JPanel(new GridBagLayout());
+    JPanel auxPanel = UIFactory.makeJPanel();
+    auxPanel.setLayout(new GridBagLayout());
     gbc.weightx = 0.0;
     gbc.insets = UIFactory.getEmptyInsets();
     gbc.gridwidth = GridBagConstraints.RELATIVE;
@@ -235,9 +236,9 @@
    */
   private Component createTitlePanel()
   {
-    JPanel titlePanel = new JPanel(new GridBagLayout());
+    JPanel titlePanel = UIFactory.makeJPanel();
+    titlePanel.setLayout(new GridBagLayout());
     GridBagConstraints gbc = new GridBagConstraints();
-    titlePanel.setOpaque(false);
     gbc.anchor = GridBagConstraints.NORTHWEST;
     gbc.fill = GridBagConstraints.BOTH;
     gbc.weightx = 0.0;
@@ -279,8 +280,8 @@
       text = getMsg("certificate-name-mismatch-text",
           ce.getHost(), String.valueOf(ce.getPort()));
     }
-    JPanel p = new JPanel(new GridBagLayout());
-    p.setOpaque(false);
+    JPanel p = UIFactory.makeJPanel();
+    p.setLayout(new GridBagLayout());
     GridBagConstraints gbc = new GridBagConstraints();
     gbc.gridwidth = GridBagConstraints.RELATIVE;
     gbc.anchor = GridBagConstraints.NORTHWEST;
@@ -318,8 +319,8 @@
    */
   private Component createButtonsPanel()
   {
-    JPanel buttonsPanel = new JPanel(new GridBagLayout());
-    buttonsPanel.setOpaque(false);
+    JPanel buttonsPanel = UIFactory.makeJPanel();
+    buttonsPanel.setLayout(new GridBagLayout());
     GridBagConstraints gbc = new GridBagConstraints();
     gbc.fill = GridBagConstraints.HORIZONTAL;
     gbc.gridwidth = 4;
@@ -369,8 +370,8 @@
    */
   private JComponent createCertificateDetailsPane()
   {
-    JPanel p = new JPanel(new GridBagLayout());
-    p.setOpaque(false);
+    JPanel p = UIFactory.makeJPanel();
+    p.setLayout(new GridBagLayout());
     if ((ce.getChain() != null) && (ce.getChain().length > 0))
     {
       final JComboBox combo = new JComboBox();
@@ -409,7 +410,8 @@
             createVersionComponent(cert),
             createPublicKeyComponent(cert)
         };
-        JPanel certPanel = new JPanel(new GridBagLayout());
+        JPanel certPanel = UIFactory.makeJPanel();
+        certPanel.setLayout(new GridBagLayout());
         GridBagConstraints gbc = new GridBagConstraints();
         gbc.anchor = GridBagConstraints.NORTHWEST;
         gbc.fill = GridBagConstraints.HORIZONTAL;
@@ -454,7 +456,8 @@
         gbc.anchor = GridBagConstraints.WEST;
         gbc.gridwidth = 3;
         gbc.fill = GridBagConstraints.HORIZONTAL;
-        JPanel auxPanel = new JPanel(new GridBagLayout());
+        JPanel auxPanel = UIFactory.makeJPanel();
+        auxPanel.setLayout(new GridBagLayout());
         JLabel l = UIFactory.makeJLabel(UIFactory.IconType.NO_ICON,
             getMsg("certificate-chain-label"),
             UIFactory.TextStyle.PRIMARY_FIELD_VALID);
@@ -574,8 +577,17 @@
 
   private JComponent createSignatureComponent(X509Certificate cert)
   {
-    String signature = String.valueOf(cert.getSignature());
-    return makeValueLabel(signature);
+    byte[] sig = cert.getSignature();
+    StringBuffer sb = new StringBuffer();
+    for (int i = 0; i < sig.length; i++)
+    {
+      if (i > 0)
+      {
+        sb.append(":");
+      }
+      sb.append(Integer.toHexString(((int) sig[i]) & 0xFF));
+    }
+    return makeValueLabel(sb.toString());
   }
 
   private JComponent createSignatureAlgorithmComponent(X509Certificate cert)

--
Gitblit v1.10.0