KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > xml > retriever > CertificationPanel


1 /*
2  * The contents of this file are subject to the terms of the Common Development
3  * and Distribution License (the License). You may not use this file except in
4  * compliance with the License.
5  *
6  * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
7  * or http://www.netbeans.org/cddl.txt.
8  *
9  * When distributing Covered Code, include this CDDL Header Notice in each file
10  * and include the License file at http://www.netbeans.org/cddl.txt.
11  * If applicable, add the following below the CDDL Header, with the fields
12  * enclosed by brackets [] replaced by your own identifying information:
13  * "Portions Copyrighted [year] [name of copyright owner]"
14  *
15  * The Original Software is NetBeans. The Initial Developer of the Original
16  * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
17  * Microsystems, Inc. All Rights Reserved.
18  */

19
20 package org.netbeans.modules.xml.retriever;
21
22 import java.math.BigInteger JavaDoc;
23 import java.security.PublicKey JavaDoc;
24 import java.security.cert.X509Certificate JavaDoc;
25 import java.util.Date JavaDoc;
26 import java.util.HashMap JavaDoc;
27 import java.util.Map JavaDoc;
28 import java.util.StringTokenizer JavaDoc;
29 import org.openide.util.NbBundle;
30
31 /** CertificationPanel
32  * Panel showing the certificate information and asking user to accept the given SSL sertificate
33  *
34  * Created on August 17, 2006, 12:55 PM
35  *
36  * @author mkuchtiak
37  */

38 public class CertificationPanel extends javax.swing.JPanel JavaDoc {
39     private X509Certificate JavaDoc cert;
40     private Map JavaDoc issuedToMap,issuedByMap;
41     /** Creates new form CertificationPanel */
42     public CertificationPanel(X509Certificate JavaDoc cert) {
43         this.cert=cert;
44         issuedToMap=new HashMap JavaDoc();
45         issuedByMap=new HashMap JavaDoc();
46         String JavaDoc issuedTo = cert.getSubjectX500Principal().getName();
47         StringTokenizer JavaDoc issuedToTokens = new StringTokenizer JavaDoc(issuedTo,",");
48         while (issuedToTokens.hasMoreTokens()) {
49             String JavaDoc token = issuedToTokens.nextToken();
50             int index = token.indexOf('=');
51             if (index>0) {
52                 issuedToMap.put(token.substring(0,index),token.substring(index+1));
53             }
54         }
55         String JavaDoc issuedBy = cert.getIssuerX500Principal().getName();
56         StringTokenizer JavaDoc issuedByTokens = new StringTokenizer JavaDoc(issuedBy,",");
57         while (issuedByTokens.hasMoreTokens()) {
58             String JavaDoc token = issuedByTokens.nextToken();
59             int index = token.indexOf('=');
60             if (index>0) {
61                 issuedByMap.put(token.substring(0,index),token.substring(index+1));
62             }
63         }
64         initComponents();
65         jTextField1.setText(getInfo(issuedToMap.get("CN"))); //NOI18N
66
jTextField2.setText(getInfo(issuedToMap.get("O"))); //NOI18N
67
jTextField3.setText(getInfo(issuedToMap.get("OU"))); //NOI18N
68
jTextField4.setText(getInfo(issuedToMap.get("L"))); //NOI18N
69
jTextField5.setText(getInfo(issuedToMap.get("ST"))); //NOI18N
70
jTextField6.setText(getInfo(issuedToMap.get("C"))); //NOI18N
71
jTextField7.setText(getSerialNoInfo(cert.getSerialNumber()));
72         jTextField8.setText(getPublicKeyInfo(cert.getPublicKey()));
73         
74         jTextField9.setText(getInfo(issuedByMap.get("CN"))); //NOI18N
75
jTextField10.setText(getInfo(issuedByMap.get("O"))); //NOI18N
76
jTextField11.setText(getInfo(issuedByMap.get("OU"))); //NOI18N
77
jTextField12.setText(getInfo(issuedByMap.get("L"))); //NOI18N
78
jTextField13.setText(getInfo(issuedByMap.get("ST"))); //NOI18N
79
jTextField14.setText(getInfo(issuedByMap.get("C"))); //NOI18N
80

81         jTextField15.setText(getDateInfo(cert.getNotBefore()));
82         jTextField16.setText(getDateInfo(cert.getNotAfter()));
83     }
84     
85     /** This method is called from within the constructor to
86      * initialize the form.
87      * WARNING: Do NOT modify this code. The content of this method is
88      * always regenerated by the Form Editor.
89      */

90     // <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents
91
private void initComponents() {
92         java.awt.GridBagConstraints JavaDoc gridBagConstraints;
93
94         jLabel1 = new javax.swing.JLabel JavaDoc();
95         jLabel2 = new javax.swing.JLabel JavaDoc();
96         jPanel1 = new javax.swing.JPanel JavaDoc();
97         jLabel5 = new javax.swing.JLabel JavaDoc();
98         jTextField1 = new javax.swing.JTextField JavaDoc();
99         jLabel6 = new javax.swing.JLabel JavaDoc();
100         jTextField2 = new javax.swing.JTextField JavaDoc();
101         jLabel7 = new javax.swing.JLabel JavaDoc();
102         jTextField3 = new javax.swing.JTextField JavaDoc();
103         jLabel8 = new javax.swing.JLabel JavaDoc();
104         jTextField4 = new javax.swing.JTextField JavaDoc();
105         jLabel9 = new javax.swing.JLabel JavaDoc();
106         jTextField5 = new javax.swing.JTextField JavaDoc();
107         jLabel10 = new javax.swing.JLabel JavaDoc();
108         jTextField6 = new javax.swing.JTextField JavaDoc();
109         jLabel11 = new javax.swing.JLabel JavaDoc();
110         jTextField7 = new javax.swing.JTextField JavaDoc();
111         jLabel12 = new javax.swing.JLabel JavaDoc();
112         jTextField8 = new javax.swing.JTextField JavaDoc();
113         jLabel3 = new javax.swing.JLabel JavaDoc();
114         jPanel2 = new javax.swing.JPanel JavaDoc();
115         jLabel13 = new javax.swing.JLabel JavaDoc();
116         jTextField9 = new javax.swing.JTextField JavaDoc();
117         jLabel14 = new javax.swing.JLabel JavaDoc();
118         jTextField10 = new javax.swing.JTextField JavaDoc();
119         jLabel15 = new javax.swing.JLabel JavaDoc();
120         jTextField11 = new javax.swing.JTextField JavaDoc();
121         jLabel16 = new javax.swing.JLabel JavaDoc();
122         jTextField12 = new javax.swing.JTextField JavaDoc();
123         jLabel17 = new javax.swing.JLabel JavaDoc();
124         jTextField13 = new javax.swing.JTextField JavaDoc();
125         jLabel18 = new javax.swing.JLabel JavaDoc();
126         jTextField14 = new javax.swing.JTextField JavaDoc();
127         jLabel19 = new javax.swing.JLabel JavaDoc();
128         jPanel3 = new javax.swing.JPanel JavaDoc();
129         jLabel20 = new javax.swing.JLabel JavaDoc();
130         jTextField15 = new javax.swing.JTextField JavaDoc();
131         jLabel21 = new javax.swing.JLabel JavaDoc();
132         jTextField16 = new javax.swing.JTextField JavaDoc();
133         jLabel4 = new javax.swing.JLabel JavaDoc();
134
135         setLayout(new java.awt.GridBagLayout JavaDoc());
136
137         setBorder(javax.swing.BorderFactory.createEmptyBorder(10, 10, 10, 10));
138         jLabel1.setText(org.openide.util.NbBundle.getMessage(CertificationPanel.class, "LBL_unableToVerify", new Object JavaDoc[] {issuedToMap.get("CN")}));
139         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
140         gridBagConstraints.gridx = 0;
141         gridBagConstraints.gridy = 0;
142         gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
143         gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
144         gridBagConstraints.insets = new java.awt.Insets JavaDoc(0, 0, 10, 0);
145         add(jLabel1, gridBagConstraints);
146
147         jLabel2.setText(org.openide.util.NbBundle.getMessage(CertificationPanel.class, "LBL_issuedTo"));
148         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
149         gridBagConstraints.gridx = 0;
150         gridBagConstraints.gridy = 1;
151         gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
152         add(jLabel2, gridBagConstraints);
153
154         jPanel1.setLayout(new java.awt.GridBagLayout JavaDoc());
155
156         jPanel1.setBorder(javax.swing.BorderFactory.createEtchedBorder());
157         jLabel5.setText(org.openide.util.NbBundle.getMessage(CertificationPanel.class, "LBL_CommonName"));
158         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
159         gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
160         gridBagConstraints.insets = new java.awt.Insets JavaDoc(0, 0, 0, 10);
161         jPanel1.add(jLabel5, gridBagConstraints);
162
163         jTextField1.setEditable(false);
164         jTextField1.setBorder(null);
165         jTextField1.setOpaque(false);
166         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
167         gridBagConstraints.gridx = 1;
168         gridBagConstraints.gridy = 0;
169         gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
170         gridBagConstraints.weightx = 1.0;
171         jPanel1.add(jTextField1, gridBagConstraints);
172
173         jLabel6.setText(org.openide.util.NbBundle.getMessage(CertificationPanel.class, "LBL_Organization"));
174         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
175         gridBagConstraints.gridx = 0;
176         gridBagConstraints.gridy = 1;
177         gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
178         gridBagConstraints.insets = new java.awt.Insets JavaDoc(0, 0, 0, 10);
179         jPanel1.add(jLabel6, gridBagConstraints);
180
181         jTextField2.setEditable(false);
182         jTextField2.setBorder(null);
183         jTextField2.setOpaque(false);
184         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
185         gridBagConstraints.gridx = 1;
186         gridBagConstraints.gridy = 1;
187         gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
188         jPanel1.add(jTextField2, gridBagConstraints);
189
190         jLabel7.setText(org.openide.util.NbBundle.getMessage(CertificationPanel.class, "LBL_OrganizationalUnit"));
191         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
192         gridBagConstraints.gridx = 0;
193         gridBagConstraints.gridy = 2;
194         gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
195         gridBagConstraints.insets = new java.awt.Insets JavaDoc(0, 0, 0, 10);
196         jPanel1.add(jLabel7, gridBagConstraints);
197
198         jTextField3.setEditable(false);
199         jTextField3.setBorder(null);
200         jTextField3.setOpaque(false);
201         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
202         gridBagConstraints.gridx = 1;
203         gridBagConstraints.gridy = 2;
204         gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
205         gridBagConstraints.weightx = 1.0;
206         jPanel1.add(jTextField3, gridBagConstraints);
207
208         jLabel8.setText(org.openide.util.NbBundle.getMessage(CertificationPanel.class, "LBL_Location"));
209         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
210         gridBagConstraints.gridx = 0;
211         gridBagConstraints.gridy = 3;
212         gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
213         gridBagConstraints.insets = new java.awt.Insets JavaDoc(0, 0, 0, 10);
214         jPanel1.add(jLabel8, gridBagConstraints);
215
216         jTextField4.setEditable(false);
217         jTextField4.setBorder(null);
218         jTextField4.setOpaque(false);
219         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
220         gridBagConstraints.gridx = 1;
221         gridBagConstraints.gridy = 3;
222         gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
223         gridBagConstraints.weightx = 1.0;
224         jPanel1.add(jTextField4, gridBagConstraints);
225
226         jLabel9.setText(org.openide.util.NbBundle.getMessage(CertificationPanel.class, "LBL_State"));
227         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
228         gridBagConstraints.gridx = 0;
229         gridBagConstraints.gridy = 4;
230         gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
231         gridBagConstraints.insets = new java.awt.Insets JavaDoc(0, 0, 0, 10);
232         jPanel1.add(jLabel9, gridBagConstraints);
233
234         jTextField5.setEditable(false);
235         jTextField5.setBorder(null);
236         jTextField5.setOpaque(false);
237         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
238         gridBagConstraints.gridx = 1;
239         gridBagConstraints.gridy = 4;
240         gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
241         gridBagConstraints.weightx = 1.0;
242         jPanel1.add(jTextField5, gridBagConstraints);
243
244         jLabel10.setText(org.openide.util.NbBundle.getMessage(CertificationPanel.class, "LBL_Country"));
245         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
246         gridBagConstraints.gridx = 0;
247         gridBagConstraints.gridy = 5;
248         gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
249         gridBagConstraints.insets = new java.awt.Insets JavaDoc(0, 0, 0, 10);
250         jPanel1.add(jLabel10, gridBagConstraints);
251
252         jTextField6.setEditable(false);
253         jTextField6.setBorder(null);
254         jTextField6.setOpaque(false);
255         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
256         gridBagConstraints.gridx = 1;
257         gridBagConstraints.gridy = 5;
258         gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
259         gridBagConstraints.weightx = 1.0;
260         jPanel1.add(jTextField6, gridBagConstraints);
261
262         jLabel11.setText(org.openide.util.NbBundle.getMessage(CertificationPanel.class, "LBL_SerialNo"));
263         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
264         gridBagConstraints.gridx = 0;
265         gridBagConstraints.gridy = 6;
266         gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
267         gridBagConstraints.insets = new java.awt.Insets JavaDoc(0, 0, 0, 10);
268         jPanel1.add(jLabel11, gridBagConstraints);
269
270         jTextField7.setEditable(false);
271         jTextField7.setBorder(null);
272         jTextField7.setOpaque(false);
273         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
274         gridBagConstraints.gridx = 1;
275         gridBagConstraints.gridy = 6;
276         gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
277         gridBagConstraints.weightx = 1.0;
278         jPanel1.add(jTextField7, gridBagConstraints);
279
280         jLabel12.setText(org.openide.util.NbBundle.getMessage(CertificationPanel.class, "LBL_PublicKeyAlg"));
281         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
282         gridBagConstraints.gridx = 0;
283         gridBagConstraints.gridy = 7;
284         gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
285         gridBagConstraints.insets = new java.awt.Insets JavaDoc(0, 0, 0, 10);
286         jPanel1.add(jLabel12, gridBagConstraints);
287
288         jTextField8.setEditable(false);
289         jTextField8.setBorder(null);
290         jTextField8.setOpaque(false);
291         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
292         gridBagConstraints.gridx = 1;
293         gridBagConstraints.gridy = 7;
294         gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
295         gridBagConstraints.weightx = 1.0;
296         jPanel1.add(jTextField8, gridBagConstraints);
297
298         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
299         gridBagConstraints.gridx = 0;
300         gridBagConstraints.gridy = 2;
301         gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
302         gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
303         gridBagConstraints.insets = new java.awt.Insets JavaDoc(0, 0, 10, 0);
304         add(jPanel1, gridBagConstraints);
305
306         jLabel3.setText(org.openide.util.NbBundle.getMessage(CertificationPanel.class, "LBL_issuedBy"));
307         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
308         gridBagConstraints.gridx = 0;
309         gridBagConstraints.gridy = 3;
310         gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
311         add(jLabel3, gridBagConstraints);
312
313         jPanel2.setLayout(new java.awt.GridBagLayout JavaDoc());
314
315         jPanel2.setBorder(javax.swing.BorderFactory.createEtchedBorder());
316         jLabel13.setText(org.openide.util.NbBundle.getMessage(CertificationPanel.class, "LBL_CommonName"));
317         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
318         gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
319         gridBagConstraints.insets = new java.awt.Insets JavaDoc(0, 0, 0, 10);
320         jPanel2.add(jLabel13, gridBagConstraints);
321
322         jTextField9.setEditable(false);
323         jTextField9.setBorder(null);
324         jTextField9.setOpaque(false);
325         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
326         gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
327         gridBagConstraints.weightx = 1.0;
328         jPanel2.add(jTextField9, gridBagConstraints);
329
330         jLabel14.setText(org.openide.util.NbBundle.getMessage(CertificationPanel.class, "LBL_Organization"));
331         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
332         gridBagConstraints.gridx = 0;
333         gridBagConstraints.gridy = 1;
334         gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
335         gridBagConstraints.insets = new java.awt.Insets JavaDoc(0, 0, 0, 10);
336         jPanel2.add(jLabel14, gridBagConstraints);
337
338         jTextField10.setEditable(false);
339         jTextField10.setBorder(null);
340         jTextField10.setOpaque(false);
341         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
342         gridBagConstraints.gridx = 1;
343         gridBagConstraints.gridy = 1;
344         gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
345         gridBagConstraints.weightx = 1.0;
346         jPanel2.add(jTextField10, gridBagConstraints);
347
348         jLabel15.setText(org.openide.util.NbBundle.getMessage(CertificationPanel.class, "LBL_OrganizationalUnit"));
349         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
350         gridBagConstraints.gridx = 0;
351         gridBagConstraints.gridy = 2;
352         gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
353         gridBagConstraints.insets = new java.awt.Insets JavaDoc(0, 0, 0, 10);
354         jPanel2.add(jLabel15, gridBagConstraints);
355
356         jTextField11.setEditable(false);
357         jTextField11.setBorder(null);
358         jTextField11.setOpaque(false);
359         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
360         gridBagConstraints.gridx = 1;
361         gridBagConstraints.gridy = 2;
362         gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
363         gridBagConstraints.weightx = 1.0;
364         jPanel2.add(jTextField11, gridBagConstraints);
365
366         jLabel16.setText(org.openide.util.NbBundle.getMessage(CertificationPanel.class, "LBL_Location"));
367         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
368         gridBagConstraints.gridx = 0;
369         gridBagConstraints.gridy = 3;
370         gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
371         gridBagConstraints.insets = new java.awt.Insets JavaDoc(0, 0, 0, 10);
372         jPanel2.add(jLabel16, gridBagConstraints);
373
374         jTextField12.setEditable(false);
375         jTextField12.setBorder(null);
376         jTextField12.setOpaque(false);
377         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
378         gridBagConstraints.gridx = 1;
379         gridBagConstraints.gridy = 3;
380         gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
381         gridBagConstraints.weightx = 1.0;
382         jPanel2.add(jTextField12, gridBagConstraints);
383
384         jLabel17.setText(org.openide.util.NbBundle.getMessage(CertificationPanel.class, "LBL_State"));
385         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
386         gridBagConstraints.gridx = 0;
387         gridBagConstraints.gridy = 4;
388         gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
389         gridBagConstraints.insets = new java.awt.Insets JavaDoc(0, 0, 0, 10);
390         jPanel2.add(jLabel17, gridBagConstraints);
391
392         jTextField13.setEditable(false);
393         jTextField13.setBorder(null);
394         jTextField13.setOpaque(false);
395         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
396         gridBagConstraints.gridx = 1;
397         gridBagConstraints.gridy = 4;
398         gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
399         gridBagConstraints.weightx = 1.0;
400         jPanel2.add(jTextField13, gridBagConstraints);
401
402         jLabel18.setText(org.openide.util.NbBundle.getMessage(CertificationPanel.class, "LBL_Country"));
403         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
404         gridBagConstraints.gridx = 0;
405         gridBagConstraints.gridy = 5;
406         gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
407         gridBagConstraints.insets = new java.awt.Insets JavaDoc(0, 0, 0, 10);
408         jPanel2.add(jLabel18, gridBagConstraints);
409
410         jTextField14.setEditable(false);
411         jTextField14.setBorder(null);
412         jTextField14.setOpaque(false);
413         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
414         gridBagConstraints.gridx = 1;
415         gridBagConstraints.gridy = 5;
416         gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
417         gridBagConstraints.weightx = 1.0;
418         jPanel2.add(jTextField14, gridBagConstraints);
419
420         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
421         gridBagConstraints.gridx = 0;
422         gridBagConstraints.gridy = 4;
423         gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
424         gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
425         gridBagConstraints.insets = new java.awt.Insets JavaDoc(0, 0, 10, 0);
426         add(jPanel2, gridBagConstraints);
427
428         jLabel19.setText(org.openide.util.NbBundle.getMessage(CertificationPanel.class, "LBL_Validity"));
429         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
430         gridBagConstraints.gridx = 0;
431         gridBagConstraints.gridy = 5;
432         gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
433         add(jLabel19, gridBagConstraints);
434
435         jPanel3.setLayout(new java.awt.GridBagLayout JavaDoc());
436
437         jPanel3.setBorder(javax.swing.BorderFactory.createEtchedBorder());
438         jLabel20.setText(org.openide.util.NbBundle.getMessage(CertificationPanel.class, "LBL_IssuedOn"));
439         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
440         gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
441         gridBagConstraints.insets = new java.awt.Insets JavaDoc(0, 0, 0, 10);
442         jPanel3.add(jLabel20, gridBagConstraints);
443
444         jTextField15.setEditable(false);
445         jTextField15.setBorder(null);
446         jTextField15.setOpaque(false);
447         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
448         gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
449         gridBagConstraints.weightx = 1.0;
450         jPanel3.add(jTextField15, gridBagConstraints);
451
452         jLabel21.setText(org.openide.util.NbBundle.getMessage(CertificationPanel.class, "LBL_ExpiresOn"));
453         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
454         gridBagConstraints.gridx = 0;
455         gridBagConstraints.gridy = 1;
456         gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
457         gridBagConstraints.insets = new java.awt.Insets JavaDoc(0, 0, 0, 10);
458         jPanel3.add(jLabel21, gridBagConstraints);
459
460         jTextField16.setEditable(false);
461         jTextField16.setBorder(null);
462         jTextField16.setOpaque(false);
463         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
464         gridBagConstraints.gridx = 1;
465         gridBagConstraints.gridy = 1;
466         gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
467         gridBagConstraints.weightx = 1.0;
468         jPanel3.add(jTextField16, gridBagConstraints);
469
470         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
471         gridBagConstraints.gridx = 0;
472         gridBagConstraints.gridy = 6;
473         gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
474         gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
475         gridBagConstraints.insets = new java.awt.Insets JavaDoc(0, 0, 10, 0);
476         add(jPanel3, gridBagConstraints);
477
478         jLabel4.setText(org.openide.util.NbBundle.getMessage(CertificationPanel.class, "LBL_acceptCertificate"));
479         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
480         gridBagConstraints.gridx = 0;
481         gridBagConstraints.gridy = 7;
482         add(jLabel4, gridBagConstraints);
483
484     }// </editor-fold>//GEN-END:initComponents
485

486     
487     // Variables declaration - do not modify//GEN-BEGIN:variables
488
private javax.swing.JLabel JavaDoc jLabel1;
489     private javax.swing.JLabel JavaDoc jLabel10;
490     private javax.swing.JLabel JavaDoc jLabel11;
491     private javax.swing.JLabel JavaDoc jLabel12;
492     private javax.swing.JLabel JavaDoc jLabel13;
493     private javax.swing.JLabel JavaDoc jLabel14;
494     private javax.swing.JLabel JavaDoc jLabel15;
495     private javax.swing.JLabel JavaDoc jLabel16;
496     private javax.swing.JLabel JavaDoc jLabel17;
497     private javax.swing.JLabel JavaDoc jLabel18;
498     private javax.swing.JLabel JavaDoc jLabel19;
499     private javax.swing.JLabel JavaDoc jLabel2;
500     private javax.swing.JLabel JavaDoc jLabel20;
501     private javax.swing.JLabel JavaDoc jLabel21;
502     private javax.swing.JLabel JavaDoc jLabel3;
503     private javax.swing.JLabel JavaDoc jLabel4;
504     private javax.swing.JLabel JavaDoc jLabel5;
505     private javax.swing.JLabel JavaDoc jLabel6;
506     private javax.swing.JLabel JavaDoc jLabel7;
507     private javax.swing.JLabel JavaDoc jLabel8;
508     private javax.swing.JLabel JavaDoc jLabel9;
509     private javax.swing.JPanel JavaDoc jPanel1;
510     private javax.swing.JPanel JavaDoc jPanel2;
511     private javax.swing.JPanel JavaDoc jPanel3;
512     private javax.swing.JTextField JavaDoc jTextField1;
513     private javax.swing.JTextField JavaDoc jTextField10;
514     private javax.swing.JTextField JavaDoc jTextField11;
515     private javax.swing.JTextField JavaDoc jTextField12;
516     private javax.swing.JTextField JavaDoc jTextField13;
517     private javax.swing.JTextField JavaDoc jTextField14;
518     private javax.swing.JTextField JavaDoc jTextField15;
519     private javax.swing.JTextField JavaDoc jTextField16;
520     private javax.swing.JTextField JavaDoc jTextField2;
521     private javax.swing.JTextField JavaDoc jTextField3;
522     private javax.swing.JTextField JavaDoc jTextField4;
523     private javax.swing.JTextField JavaDoc jTextField5;
524     private javax.swing.JTextField JavaDoc jTextField6;
525     private javax.swing.JTextField JavaDoc jTextField7;
526     private javax.swing.JTextField JavaDoc jTextField8;
527     private javax.swing.JTextField JavaDoc jTextField9;
528     // End of variables declaration//GEN-END:variables
529

530     
531     private String JavaDoc getInfo(Object JavaDoc entry) {
532         return entry==null?NbBundle.getMessage(CertificationPanel.class, "TXT_NotSpecified"):(String JavaDoc)entry;
533     }
534     
535     private String JavaDoc getDateInfo(Date JavaDoc date) {
536         return date==null?NbBundle.getMessage(CertificationPanel.class, "TXT_NotSpecified"):date.toString();
537     }
538     
539     private String JavaDoc getSerialNoInfo(BigInteger JavaDoc sn) {
540         return sn==null?NbBundle.getMessage(CertificationPanel.class, "TXT_NotSpecified"):sn.toString();
541     }
542     
543     private String JavaDoc getPublicKeyInfo(PublicKey JavaDoc pk) {
544         if (pk==null) return NbBundle.getMessage(CertificationPanel.class, "TXT_NotSpecified");
545         else {
546             String JavaDoc algorithm = pk.getAlgorithm();
547             return algorithm==null?NbBundle.getMessage(CertificationPanel.class, "TXT_NotSpecified"):algorithm;
548         }
549     }
550 }
551
Popular Tags