src/java.base/share/classes/java/security/cert/PKIXCertPathBuilderResult.java

Print this page
rev 10521 : 8055723[core]: Replace concat String to append in StringBuilder parameters
Contributed-by: Otavio Santana <otaviojava@java.net>


  92      * obtain the {@code TrustAnchor} that served as the trust anchor
  93      * for the certification path.
  94      *
  95      * @return the built and validated {@code CertPath} (never
  96      * {@code null})
  97      */
  98     public CertPath getCertPath() {
  99         return certPath;
 100     }
 101 
 102     /**
 103      * Return a printable representation of this
 104      * {@code PKIXCertPathBuilderResult}.
 105      *
 106      * @return a {@code String} describing the contents of this
 107      *         {@code PKIXCertPathBuilderResult}
 108      */
 109     public String toString() {
 110         StringBuilder sb = new StringBuilder();
 111         sb.append("PKIXCertPathBuilderResult: [\n");
 112         sb.append("  Certification Path: " + certPath + "\n");
 113         sb.append("  Trust Anchor: " + getTrustAnchor().toString() + "\n");
 114         sb.append("  Policy Tree: " + String.valueOf(getPolicyTree()) + "\n");
 115         sb.append("  Subject Public Key: " + getPublicKey() + "\n");
 116         sb.append("]");


 117         return sb.toString();
 118     }
 119 }


  92      * obtain the {@code TrustAnchor} that served as the trust anchor
  93      * for the certification path.
  94      *
  95      * @return the built and validated {@code CertPath} (never
  96      * {@code null})
  97      */
  98     public CertPath getCertPath() {
  99         return certPath;
 100     }
 101 
 102     /**
 103      * Return a printable representation of this
 104      * {@code PKIXCertPathBuilderResult}.
 105      *
 106      * @return a {@code String} describing the contents of this
 107      *         {@code PKIXCertPathBuilderResult}
 108      */
 109     public String toString() {
 110         StringBuilder sb = new StringBuilder();
 111         sb.append("PKIXCertPathBuilderResult: [\n");
 112         sb.append("  Certification Path: ").append(certPath).append('\n');
 113         sb.append("  Trust Anchor: ").append(getTrustAnchor())
 114                 .append('\n');
 115         sb.append("  Policy Tree: ").append(getPolicyTree())
 116                 .append('\n');
 117         sb.append("  Subject Public Key: ").append(getPublicKey()).append('\n');
 118         sb.append(']');
 119         return sb.toString();
 120     }
 121 }