// since a distinguished name has variable length, we need to write length field for each name as well, has influence on total length!
writer.write(distinguishedName.getName().length, CERTIFICATE_AUTHORITY_LENGTH_BITS);
writer.writeBytes(distinguishedName.getName());
}
return writer.toByteArray();
}
public static HandshakeMessage fromByteArray(byte[] byteArray) {
DatagramReader reader = new DatagramReader(byteArray);