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

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


 555      * @return the certificate being checked (or {@code null})
 556      * @see #setCertificateChecking
 557      */
 558     public X509Certificate getCertificateChecking() {
 559         return certChecking;
 560     }
 561 
 562     /**
 563      * Returns a printable representation of the {@code X509CRLSelector}.
 564      *
 565      * @return a {@code String} describing the contents of the
 566      *         {@code X509CRLSelector}.
 567      */
 568     public String toString() {
 569         StringBuilder sb = new StringBuilder();
 570         sb.append("X509CRLSelector: [\n");
 571         if (issuerNames != null) {
 572             sb.append("  IssuerNames:\n");
 573             Iterator<Object> i = issuerNames.iterator();
 574             while (i.hasNext())
 575                 sb.append("    " + i.next() + "\n");
 576         }
 577         if (minCRL != null)
 578             sb.append("  minCRLNumber: " + minCRL + "\n");
 579         if (maxCRL != null)
 580             sb.append("  maxCRLNumber: " + maxCRL + "\n");
 581         if (dateAndTime != null)
 582             sb.append("  dateAndTime: " + dateAndTime + "\n");
 583         if (certChecking != null)
 584             sb.append("  Certificate being checked: " + certChecking + "\n");
 585         sb.append("]");
 586         return sb.toString();
 587     }
 588 
 589     /**
 590      * Decides whether a {@code CRL} should be selected.
 591      *
 592      * @param crl the {@code CRL} to be checked
 593      * @return {@code true} if the {@code CRL} should be selected,
 594      *         {@code false} otherwise
 595      */
 596     public boolean match(CRL crl) {
 597         if (!(crl instanceof X509CRL)) {
 598             return false;
 599         }
 600         X509CRL xcrl = (X509CRL)crl;
 601 
 602         /* match on issuer name */
 603         if (issuerNames != null) {
 604             X500Principal issuer = xcrl.getIssuerX500Principal();
 605             Iterator<X500Principal> i = issuerX500Principals.iterator();




 555      * @return the certificate being checked (or {@code null})
 556      * @see #setCertificateChecking
 557      */
 558     public X509Certificate getCertificateChecking() {
 559         return certChecking;
 560     }
 561 
 562     /**
 563      * Returns a printable representation of the {@code X509CRLSelector}.
 564      *
 565      * @return a {@code String} describing the contents of the
 566      *         {@code X509CRLSelector}.
 567      */
 568     public String toString() {
 569         StringBuilder sb = new StringBuilder();
 570         sb.append("X509CRLSelector: [\n");
 571         if (issuerNames != null) {
 572             sb.append("  IssuerNames:\n");
 573             Iterator<Object> i = issuerNames.iterator();
 574             while (i.hasNext())
 575                 sb.append("    ").append(i.next()).append('\n');
 576         }
 577         if (minCRL != null)
 578             sb.append("  minCRLNumber: ").append(minCRL).append('\n');
 579         if (maxCRL != null)
 580             sb.append("  maxCRLNumber: ").append(maxCRL).append('\n');
 581         if (dateAndTime != null)
 582             sb.append("  dateAndTime: ").append(dateAndTime).append('\n');
 583         if (certChecking != null)
 584             sb.append("  Certificate being checked: ").append(certChecking).append('\n');
 585         sb.append(']');
 586         return sb.toString();
 587     }
 588 
 589     /**
 590      * Decides whether a {@code CRL} should be selected.
 591      *
 592      * @param crl the {@code CRL} to be checked
 593      * @return {@code true} if the {@code CRL} should be selected,
 594      *         {@code false} otherwise
 595      */
 596     public boolean match(CRL crl) {
 597         if (!(crl instanceof X509CRL)) {
 598             return false;
 599         }
 600         X509CRL xcrl = (X509CRL)crl;
 601 
 602         /* match on issuer name */
 603         if (issuerNames != null) {
 604             X500Principal issuer = xcrl.getIssuerX500Principal();
 605             Iterator<X500Principal> i = issuerX500Principals.iterator();