*/
public void present(byte[] client_random, byte[] rsa_data, byte[] licence_data, int licence_size, byte[] hwid, byte[] signature) throws RdesktopException, IOException, CryptoException {
int sec_flags = Secure.SEC_LICENCE_NEG;
int length = /* rdesktop is 16 not 20, but this must be wrong?! */ 20 + Secure.SEC_RANDOM_SIZE + Secure.SEC_MODULUS_SIZE + Secure.SEC_PADDING_SIZE + licence_size + LICENCE_HWID_SIZE + LICENCE_SIGNATURE_SIZE;
RdpPackage s = secure.init(sec_flags, length + 4);
s.set8(LICENCE_TAG_PRESENT);
s.set8(2); // version
s.setLittleEndian16(length);
s.setLittleEndian32(1);
s.setLittleEndian16(0);
s.setLittleEndian16(0x0201);
s.copyFromByteArray(client_random, 0, s.getPosition(), Secure.SEC_RANDOM_SIZE);
s.incrementPosition(Secure.SEC_RANDOM_SIZE);
s.setLittleEndian16(0);
s.setLittleEndian16((Secure.SEC_MODULUS_SIZE + Secure.SEC_PADDING_SIZE));
s.copyFromByteArray(rsa_data, 0, s.getPosition(), Secure.SEC_MODULUS_SIZE);
s.incrementPosition(Secure.SEC_MODULUS_SIZE);
s.incrementPosition(Secure.SEC_PADDING_SIZE);
s.setLittleEndian16(1);
s.setLittleEndian16(licence_size);
s.copyFromByteArray(licence_data, 0, s.getPosition(), licence_size);
s.incrementPosition(licence_size);
s.setLittleEndian16(1);
s.setLittleEndian16(LICENCE_HWID_SIZE);
s.copyFromByteArray(hwid, 0, s.getPosition(), LICENCE_HWID_SIZE);
s.incrementPosition(LICENCE_HWID_SIZE);
s.copyFromByteArray(signature, 0, s.getPosition(), LICENCE_SIGNATURE_SIZE);
s.incrementPosition(LICENCE_SIGNATURE_SIZE);
s.markEnd();
secure.send(s, sec_flags);
}