src/java.base/share/classes/sun/security/pkcs/SigningCertificateInfo.java

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


 141         certHash = certId.data.getDerValue().toByteArray();
 142 
 143         // Parse issuerSerial, if present
 144         if (certId.data.available() > 0) {
 145             DerValue issuerSerial = certId.data.getDerValue();
 146             // Parse issuer
 147             issuer = new GeneralNames(issuerSerial.data.getDerValue());
 148             // Parse serialNumber
 149             serialNumber = new SerialNumber(issuerSerial.data.getDerValue());
 150         }
 151     }
 152 
 153     public String toString() {
 154         StringBuilder sb = new StringBuilder();
 155         sb.append("[\n\tCertificate hash (SHA-1):\n");
 156         if (hexDumper == null) {
 157             hexDumper = new HexDumpEncoder();
 158         }
 159         sb.append(hexDumper.encode(certHash));
 160         if (issuer != null && serialNumber != null) {
 161             sb.append("\n\tIssuer: " + issuer + "\n");
 162             sb.append("\t" + serialNumber);
 163         }
 164         sb.append("\n]");
 165         return sb.toString();
 166     }
 167 }


 141         certHash = certId.data.getDerValue().toByteArray();
 142 
 143         // Parse issuerSerial, if present
 144         if (certId.data.available() > 0) {
 145             DerValue issuerSerial = certId.data.getDerValue();
 146             // Parse issuer
 147             issuer = new GeneralNames(issuerSerial.data.getDerValue());
 148             // Parse serialNumber
 149             serialNumber = new SerialNumber(issuerSerial.data.getDerValue());
 150         }
 151     }
 152 
 153     public String toString() {
 154         StringBuilder sb = new StringBuilder();
 155         sb.append("[\n\tCertificate hash (SHA-1):\n");
 156         if (hexDumper == null) {
 157             hexDumper = new HexDumpEncoder();
 158         }
 159         sb.append(hexDumper.encode(certHash));
 160         if (issuer != null && serialNumber != null) {
 161             sb.append("\n\tIssuer: ").append(issuer).append('\n');
 162             sb.append('\t').append(serialNumber);
 163         }
 164         sb.append("\n]");
 165         return sb.toString();
 166     }
 167 }