ByteBuffer messageSignatureAndEncryptedServerPublicKey = generateMessageSignatureAndEncryptedServerPublicKey(ntlmState);
// Length of packet
ByteBuffer buf = new ByteBuffer(4096, true);
TSRequest tsRequest = new TSRequest("TSRequest");
tsRequest.version.value = 2L;
NegoItem negoItem = new NegoItem("NegoItem");
negoItem.negoToken.value = authenticateMessage;
tsRequest.negoTokens.tags = new Tag[] {negoItem};
tsRequest.pubKeyAuth.value = messageSignatureAndEncryptedServerPublicKey;
tsRequest.writeTag(buf);
// Trim buffer to actual length of data written
buf.trimAtCursor();
pushDataToOTOut(buf);