1 19 20 package org.netbeans.modules.xml.retriever; 21 22 import java.math.BigInteger ; 23 import java.security.PublicKey ; 24 import java.security.cert.X509Certificate ; 25 import java.util.Date ; 26 import java.util.HashMap ; 27 import java.util.Map ; 28 import java.util.StringTokenizer ; 29 import org.openide.util.NbBundle; 30 31 38 public class CertificationPanel extends javax.swing.JPanel { 39 private X509Certificate cert; 40 private Map issuedToMap,issuedByMap; 41 42 public CertificationPanel(X509Certificate cert) { 43 this.cert=cert; 44 issuedToMap=new HashMap (); 45 issuedByMap=new HashMap (); 46 String issuedTo = cert.getSubjectX500Principal().getName(); 47 StringTokenizer issuedToTokens = new StringTokenizer (issuedTo,","); 48 while (issuedToTokens.hasMoreTokens()) { 49 String 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 issuedBy = cert.getIssuerX500Principal().getName(); 56 StringTokenizer issuedByTokens = new StringTokenizer (issuedBy,","); 57 while (issuedByTokens.hasMoreTokens()) { 58 String 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"))); jTextField2.setText(getInfo(issuedToMap.get("O"))); jTextField3.setText(getInfo(issuedToMap.get("OU"))); jTextField4.setText(getInfo(issuedToMap.get("L"))); jTextField5.setText(getInfo(issuedToMap.get("ST"))); jTextField6.setText(getInfo(issuedToMap.get("C"))); jTextField7.setText(getSerialNoInfo(cert.getSerialNumber())); 72 jTextField8.setText(getPublicKeyInfo(cert.getPublicKey())); 73 74 jTextField9.setText(getInfo(issuedByMap.get("CN"))); jTextField10.setText(getInfo(issuedByMap.get("O"))); jTextField11.setText(getInfo(issuedByMap.get("OU"))); jTextField12.setText(getInfo(issuedByMap.get("L"))); jTextField13.setText(getInfo(issuedByMap.get("ST"))); jTextField14.setText(getInfo(issuedByMap.get("C"))); 81 jTextField15.setText(getDateInfo(cert.getNotBefore())); 82 jTextField16.setText(getDateInfo(cert.getNotAfter())); 83 } 84 85 90 private void initComponents() { 92 java.awt.GridBagConstraints gridBagConstraints; 93 94 jLabel1 = new javax.swing.JLabel (); 95 jLabel2 = new javax.swing.JLabel (); 96 jPanel1 = new javax.swing.JPanel (); 97 jLabel5 = new javax.swing.JLabel (); 98 jTextField1 = new javax.swing.JTextField (); 99 jLabel6 = new javax.swing.JLabel (); 100 jTextField2 = new javax.swing.JTextField (); 101 jLabel7 = new javax.swing.JLabel (); 102 jTextField3 = new javax.swing.JTextField (); 103 jLabel8 = new javax.swing.JLabel (); 104 jTextField4 = new javax.swing.JTextField (); 105 jLabel9 = new javax.swing.JLabel (); 106 jTextField5 = new javax.swing.JTextField (); 107 jLabel10 = new javax.swing.JLabel (); 108 jTextField6 = new javax.swing.JTextField (); 109 jLabel11 = new javax.swing.JLabel (); 110 jTextField7 = new javax.swing.JTextField (); 111 jLabel12 = new javax.swing.JLabel (); 112 jTextField8 = new javax.swing.JTextField (); 113 jLabel3 = new javax.swing.JLabel (); 114 jPanel2 = new javax.swing.JPanel (); 115 jLabel13 = new javax.swing.JLabel (); 116 jTextField9 = new javax.swing.JTextField (); 117 jLabel14 = new javax.swing.JLabel (); 118 jTextField10 = new javax.swing.JTextField (); 119 jLabel15 = new javax.swing.JLabel (); 120 jTextField11 = new javax.swing.JTextField (); 121 jLabel16 = new javax.swing.JLabel (); 122 jTextField12 = new javax.swing.JTextField (); 123 jLabel17 = new javax.swing.JLabel (); 124 jTextField13 = new javax.swing.JTextField (); 125 jLabel18 = new javax.swing.JLabel (); 126 jTextField14 = new javax.swing.JTextField (); 127 jLabel19 = new javax.swing.JLabel (); 128 jPanel3 = new javax.swing.JPanel (); 129 jLabel20 = new javax.swing.JLabel (); 130 jTextField15 = new javax.swing.JTextField (); 131 jLabel21 = new javax.swing.JLabel (); 132 jTextField16 = new javax.swing.JTextField (); 133 jLabel4 = new javax.swing.JLabel (); 134 135 setLayout(new java.awt.GridBagLayout ()); 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 [] {issuedToMap.get("CN")})); 139 gridBagConstraints = new java.awt.GridBagConstraints (); 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 (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 (); 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 ()); 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 (); 159 gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; 160 gridBagConstraints.insets = new java.awt.Insets (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 (); 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 (); 175 gridBagConstraints.gridx = 0; 176 gridBagConstraints.gridy = 1; 177 gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; 178 gridBagConstraints.insets = new java.awt.Insets (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 (); 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 (); 192 gridBagConstraints.gridx = 0; 193 gridBagConstraints.gridy = 2; 194 gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; 195 gridBagConstraints.insets = new java.awt.Insets (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 (); 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 (); 210 gridBagConstraints.gridx = 0; 211 gridBagConstraints.gridy = 3; 212 gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; 213 gridBagConstraints.insets = new java.awt.Insets (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 (); 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 (); 228 gridBagConstraints.gridx = 0; 229 gridBagConstraints.gridy = 4; 230 gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; 231 gridBagConstraints.insets = new java.awt.Insets (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 (); 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 (); 246 gridBagConstraints.gridx = 0; 247 gridBagConstraints.gridy = 5; 248 gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; 249 gridBagConstraints.insets = new java.awt.Insets (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 (); 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 (); 264 gridBagConstraints.gridx = 0; 265 gridBagConstraints.gridy = 6; 266 gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; 267 gridBagConstraints.insets = new java.awt.Insets (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 (); 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 (); 282 gridBagConstraints.gridx = 0; 283 gridBagConstraints.gridy = 7; 284 gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; 285 gridBagConstraints.insets = new java.awt.Insets (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 (); 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 (); 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 (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 (); 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 ()); 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 (); 318 gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; 319 gridBagConstraints.insets = new java.awt.Insets (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 (); 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 (); 332 gridBagConstraints.gridx = 0; 333 gridBagConstraints.gridy = 1; 334 gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; 335 gridBagConstraints.insets = new java.awt.Insets (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 (); 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 (); 350 gridBagConstraints.gridx = 0; 351 gridBagConstraints.gridy = 2; 352 gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; 353 gridBagConstraints.insets = new java.awt.Insets (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 (); 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 (); 368 gridBagConstraints.gridx = 0; 369 gridBagConstraints.gridy = 3; 370 gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; 371 gridBagConstraints.insets = new java.awt.Insets (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 (); 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 (); 386 gridBagConstraints.gridx = 0; 387 gridBagConstraints.gridy = 4; 388 gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; 389 gridBagConstraints.insets = new java.awt.Insets (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 (); 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 (); 404 gridBagConstraints.gridx = 0; 405 gridBagConstraints.gridy = 5; 406 gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; 407 gridBagConstraints.insets = new java.awt.Insets (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 (); 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 (); 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 (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 (); 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 ()); 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 (); 440 gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; 441 gridBagConstraints.insets = new java.awt.Insets (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 (); 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 (); 454 gridBagConstraints.gridx = 0; 455 gridBagConstraints.gridy = 1; 456 gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; 457 gridBagConstraints.insets = new java.awt.Insets (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 (); 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 (); 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 (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 (); 480 gridBagConstraints.gridx = 0; 481 gridBagConstraints.gridy = 7; 482 add(jLabel4, gridBagConstraints); 483 484 } 486 487 private javax.swing.JLabel jLabel1; 489 private javax.swing.JLabel jLabel10; 490 private javax.swing.JLabel jLabel11; 491 private javax.swing.JLabel jLabel12; 492 private javax.swing.JLabel jLabel13; 493 private javax.swing.JLabel jLabel14; 494 private javax.swing.JLabel jLabel15; 495 private javax.swing.JLabel jLabel16; 496 private javax.swing.JLabel jLabel17; 497 private javax.swing.JLabel jLabel18; 498 private javax.swing.JLabel jLabel19; 499 private javax.swing.JLabel jLabel2; 500 private javax.swing.JLabel jLabel20; 501 private javax.swing.JLabel jLabel21; 502 private javax.swing.JLabel jLabel3; 503 private javax.swing.JLabel jLabel4; 504 private javax.swing.JLabel jLabel5; 505 private javax.swing.JLabel jLabel6; 506 private javax.swing.JLabel jLabel7; 507 private javax.swing.JLabel jLabel8; 508 private javax.swing.JLabel jLabel9; 509 private javax.swing.JPanel jPanel1; 510 private javax.swing.JPanel jPanel2; 511 private javax.swing.JPanel jPanel3; 512 private javax.swing.JTextField jTextField1; 513 private javax.swing.JTextField jTextField10; 514 private javax.swing.JTextField jTextField11; 515 private javax.swing.JTextField jTextField12; 516 private javax.swing.JTextField jTextField13; 517 private javax.swing.JTextField jTextField14; 518 private javax.swing.JTextField jTextField15; 519 private javax.swing.JTextField jTextField16; 520 private javax.swing.JTextField jTextField2; 521 private javax.swing.JTextField jTextField3; 522 private javax.swing.JTextField jTextField4; 523 private javax.swing.JTextField jTextField5; 524 private javax.swing.JTextField jTextField6; 525 private javax.swing.JTextField jTextField7; 526 private javax.swing.JTextField jTextField8; 527 private javax.swing.JTextField jTextField9; 528 530 531 private String getInfo(Object entry) { 532 return entry==null?NbBundle.getMessage(CertificationPanel.class, "TXT_NotSpecified"):(String )entry; 533 } 534 535 private String getDateInfo(Date date) { 536 return date==null?NbBundle.getMessage(CertificationPanel.class, "TXT_NotSpecified"):date.toString(); 537 } 538 539 private String getSerialNoInfo(BigInteger sn) { 540 return sn==null?NbBundle.getMessage(CertificationPanel.class, "TXT_NotSpecified"):sn.toString(); 541 } 542 543 private String getPublicKeyInfo(PublicKey pk) { 544 if (pk==null) return NbBundle.getMessage(CertificationPanel.class, "TXT_NotSpecified"); 545 else { 546 String algorithm = pk.getAlgorithm(); 547 return algorithm==null?NbBundle.getMessage(CertificationPanel.class, "TXT_NotSpecified"):algorithm; 548 } 549 } 550 } 551 | Popular Tags |