writer.write(getMessageLength() - (CERTIFICATE_LIST_LENGTH/8), CERTIFICATE_LIST_LENGTH);
for (byte[] encoded : encodedChain) {
// the size of the current certificate
writer.write(encoded.length, CERTIFICATE_LENGTH_BITS);
// the encoded current certificate
writer.writeBytes(encoded);
}
} else {
writer.write(getMessageLength() - 3, CERTIFICATE_LIST_LENGTH);
writer.write(rawPublicKeyBytes.length, CERTIFICATE_LENGTH_BITS);
writer.writeBytes(rawPublicKeyBytes);