CertificateVerifySerializer extends HandshakeMessageSerializer<CertificateVerifyMessage> { @Override public byte[] serializeHandshakeMessageContent() { LOGGER.debug("Serializing CertificateVerifyMessage"); if (version == ProtocolVersion.TLS12 || version == ProtocolVersion.DTLS12 || version.isTLS13()) { writeSignatureHashAlgorithm(msg); } writeSignatureLength(msg); writeSignature(msg); return getAlreadySerialized(); } CertificateVerifySerializer(CertificateVerifyMessage message, ProtocolVersion version); @Override byte[] serializeHandshakeMessageContent();  }
@Test public void testSerializeHandshakeMessageContent() { CertificateVerifyMessage message = new CertificateVerifyMessage(); message.setLength(length); message.setType(type.getValue()); message.setSignature(signature); message.setSignatureLength(signatureLength); message.setSignatureHashAlgorithm(sigHashAlgo); CertificateVerifySerializer serializer = new CertificateVerifySerializer(message, ProtocolVersion.TLS12); assertArrayEquals(expectedPart, serializer.serialize()); }