src/java.base/share/classes/sun/security/provider/certpath/CertId.java

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


 206             return false;
 207         }
 208 
 209         CertId that = (CertId) other;
 210         if (hashAlgId.equals(that.getHashAlgorithm()) &&
 211             Arrays.equals(issuerNameHash, that.getIssuerNameHash()) &&
 212             Arrays.equals(issuerKeyHash, that.getIssuerKeyHash()) &&
 213             certSerialNumber.getNumber().equals(that.getSerialNumber())) {
 214             return true;
 215         } else {
 216             return false;
 217         }
 218     }
 219 
 220     /**
 221      * Create a string representation of the CertId.
 222      */
 223     @Override public String toString() {
 224         StringBuilder sb = new StringBuilder();
 225         sb.append("CertId \n");
 226         sb.append("Algorithm: " + hashAlgId.toString() +"\n");
 227         sb.append("issuerNameHash \n");
 228         HexDumpEncoder encoder = new HexDumpEncoder();
 229         sb.append(encoder.encode(issuerNameHash));
 230         sb.append("\nissuerKeyHash: \n");
 231         sb.append(encoder.encode(issuerKeyHash));
 232         sb.append("\n" +  certSerialNumber.toString());
 233         return sb.toString();
 234     }
 235 }


 206             return false;
 207         }
 208 
 209         CertId that = (CertId) other;
 210         if (hashAlgId.equals(that.getHashAlgorithm()) &&
 211             Arrays.equals(issuerNameHash, that.getIssuerNameHash()) &&
 212             Arrays.equals(issuerKeyHash, that.getIssuerKeyHash()) &&
 213             certSerialNumber.getNumber().equals(that.getSerialNumber())) {
 214             return true;
 215         } else {
 216             return false;
 217         }
 218     }
 219 
 220     /**
 221      * Create a string representation of the CertId.
 222      */
 223     @Override public String toString() {
 224         StringBuilder sb = new StringBuilder();
 225         sb.append("CertId \n");
 226         sb.append("Algorithm: ").append(hashAlgId).append('\n');
 227         sb.append("issuerNameHash \n");
 228         HexDumpEncoder encoder = new HexDumpEncoder();
 229         sb.append(encoder.encode(issuerNameHash));
 230         sb.append("\nissuerKeyHash: \n");
 231         sb.append(encoder.encode(issuerKeyHash));
 232         sb.append('\n').append(certSerialNumber);
 233         return sb.toString();
 234     }
 235 }