1 7 8 package java.security.cert; 9 10 import java.security.PublicKey ; 11 12 41 public class PKIXCertPathValidatorResult implements CertPathValidatorResult { 42 43 private TrustAnchor trustAnchor; 44 private PolicyNode policyTree; 45 private PublicKey subjectPublicKey; 46 47 59 public PKIXCertPathValidatorResult(TrustAnchor trustAnchor, 60 PolicyNode policyTree, PublicKey subjectPublicKey) 61 { 62 if (subjectPublicKey == null) 63 throw new NullPointerException ("subjectPublicKey must be non-null"); 64 if (trustAnchor == null) 65 throw new NullPointerException ("trustAnchor must be non-null"); 66 this.trustAnchor = trustAnchor; 67 this.policyTree = policyTree; 68 this.subjectPublicKey = subjectPublicKey; 69 } 70 71 77 public TrustAnchor getTrustAnchor() { 78 return trustAnchor; 79 } 80 81 98 public PolicyNode getPolicyTree() { 99 return policyTree; 100 } 101 102 108 public PublicKey getPublicKey() { 109 return subjectPublicKey; 110 } 111 112 117 public Object clone() { 118 try { 119 return super.clone(); 120 } catch (CloneNotSupportedException e) { 121 122 throw new InternalError (e.toString()); 123 } 124 } 125 126 133 public String toString() { 134 StringBuffer sb = new StringBuffer (); 135 sb.append("PKIXCertPathValidatorResult: [\n"); 136 sb.append(" Trust Anchor: " + trustAnchor.toString() + "\n"); 137 sb.append(" Policy Tree: " + String.valueOf(policyTree) + "\n"); 138 sb.append(" Subject Public Key: " + subjectPublicKey + "\n"); 139 sb.append("]"); 140 return sb.toString(); 141 } 142 } 143 | Popular Tags |