CertificateRequestMessage extends HandshakeMessage { @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("CertificateRequestMessage:"); sb.append("\n Certificate Types Count: "); if (clientCertificateTypesCount != null && clientCertificateTypesCount.getValue() != null) { sb.append(clientCertificateTypesCount.getValue()); } else { sb.append("null"); } sb.append("\n Certificate Types: "); if (clientCertificateTypes != null && clientCertificateTypes.getValue() != null) { for (int i = 0; i < clientCertificateTypes.getValue().length; i++) { sb.append(ClientCertificateType.getClientCertificateType(clientCertificateTypes.getValue()[i])).append( ", "); } } else { sb.append("null"); } sb.append("\n Signature Hash Algorithms Length: "); if (signatureHashAlgorithmsLength != null && signatureHashAlgorithmsLength.getValue() != null) { sb.append(signatureHashAlgorithmsLength.getValue()); } else { sb.append("null"); } sb.append("\n Signature Hash Algorithms: "); if (signatureHashAlgorithms != null && signatureHashAlgorithms.getValue() != null) { try { List<SignatureAndHashAlgorithm> signatureAndHashAlgorithms = SignatureAndHashAlgorithm .getSignatureAndHashAlgorithms(signatureHashAlgorithms.getValue()); for (SignatureAndHashAlgorithm algo : signatureAndHashAlgorithms) { sb.append(algo.name()); } } catch (Exception E) { LOGGER.debug(E); LOGGER.debug("Signature and HashAlgorithms contain unparseable Algorithms:" + ArrayConverter.bytesToHexString(signatureHashAlgorithms)); } } else { sb.append("null"); } sb.append("\n Distinguished Names Length: "); if (distinguishedNamesLength != null && distinguishedNamesLength.getValue() != null) { sb.append(distinguishedNamesLength.getValue()); } else { sb.append("null"); } return sb.toString(); } CertificateRequestMessage();  CertificateRequestMessage(Config tlsConfig); ModifiableInteger getClientCertificateTypesCount(); void setClientCertificateTypesCount(ModifiableInteger clientCertificateTypesCount); void setClientCertificateTypesCount(int clientCertificateTypesCount); ModifiableByteArray getClientCertificateTypes(); void setClientCertificateTypes(ModifiableByteArray clientCertificateTypes); void setClientCertificateTypes(byte[] clientCertificateTypes); ModifiableInteger getSignatureHashAlgorithmsLength(); void setSignatureHashAlgorithmsLength(ModifiableInteger signatureHashAlgorithmsLength); void setSignatureHashAlgorithmsLength(int signatureHashAlgorithmsLength); ModifiableByteArray getSignatureHashAlgorithms(); void setSignatureHashAlgorithms(ModifiableByteArray signatureHashAlgorithms); void setSignatureHashAlgorithms(byte[] signatureHashAlgorithms); ModifiableInteger getDistinguishedNamesLength(); void setDistinguishedNamesLength(ModifiableInteger distinguishedNamesLength); void setDistinguishedNamesLength(int distinguishedNamesLength); ModifiableByteArray getDistinguishedNames(); void setDistinguishedNames(ModifiableByteArray distinguishedNames); void setDistinguishedNames(byte[] distinguishedNames); ModifiableInteger getCertificateRequestContextLength(); void setCertificateRequestContextLength(ModifiableInteger certificateRequestContextLength); void setCertificateRequestContextLength(int certificateRequestContextLength); ModifiableByteArray getCertificateRequestContext(); void setCertificateRequestContext(ModifiableByteArray certificateRequestContext); void setCertificateRequestContext(byte[] certificateRequestContext); @Override String toString(); @Override ProtocolMessageHandler getHandler(TlsContext context);  }
@Test public void testToString() { StringBuilder sb = new StringBuilder(); sb.append("CertificateRequestMessage:"); sb.append("\n Certificate Types Count: ").append("null"); sb.append("\n Certificate Types: ").append("null"); sb.append("\n Signature Hash Algorithms Length: ").append("null"); sb.append("\n Signature Hash Algorithms: ").append("null"); sb.append("\n Distinguished Names Length: ").append("null"); assertEquals(message.toString(), sb.toString()); }