1 20 21 package org.jacorb.security.util; 22 23 29 30 import java.security.*; 31 import java.security.cert.*; 32 import java.util.*; 33 import javax.swing.tree.*; 34 import iaik.asn1.*; 35 import iaik.asn1.structures.*; 36 import iaik.x509.*; 37 import iaik.x509.extensions.*; 38 39 public class CertNode 40 implements KSNode 41 { 42 44 45 private String label; 46 private KeyNode parent; 47 private int chainIndex; 48 private iaik.x509.X509Certificate cert; 49 50 53 54 public CertNode(iaik.x509.X509Certificate cert, int index) 55 { 56 this.cert = cert; 57 chainIndex = index; 58 } 59 60 public iaik.x509.X509Certificate getCert() 61 { 62 return cert; 63 } 64 65 66 67 public Enumeration children() 68 { 69 return null; 70 } 71 72 public boolean getAllowsChildren() 73 { 74 return false; 75 } 76 77 public TreeNode getChildAt(int index) 78 { 79 return null; 80 } 81 82 public int getChildCount() 83 { 84 return 0; 85 } 86 87 public int getIndex(TreeNode node) 88 { 89 return -1; 90 } 91 92 public TreeNode getParent() 93 { 94 return parent; 95 } 96 97 public boolean isLeaf() 98 { 99 return true; 100 } 101 102 103 104 public void insert(MutableTreeNode child, int index) 105 { 106 } 107 108 public void remove(int index) 109 { 110 } 111 112 public void remove(MutableTreeNode child) 113 { 114 } 115 116 public void setParent(MutableTreeNode parent) 117 { 118 this.parent = (KeyNode)parent; 119 } 120 121 public void setUserObject(Object o) 122 {} 123 124 125 public void removeFromParent() 126 { 127 parent.remove(this); 128 parent = null; 129 } 130 131 public String toString() 132 { 133 return "subject: " + cert.getSubjectDN().getName() + " issuer: " + cert.getIssuerDN().getName(); 134 } 135 136 public TreeNode[] getPath() 137 { 138 if( parent == null ) 139 return null; 140 else 141 return new TreeNode[] { getParent().getParent(), getParent() }; 142 } 143 144 } 145 146 147 148 149 150 151 152 153 154 155 156 157 158 | Popular Tags |