WrapTokenV2(GssContext context,
byte[] data,
int dataOffset,
int dataLength,
MessageProp messageProp) throws GSSException {
super(TOKEN_WRAP_V2, context);
prop = messageProp;
if (prop.getQOP() != 0) {
prop.setQOP(0);
}
if (!context.getConfState()) {
prop.setPrivacy(false);
}
generateCheckSum(prop, data, dataOffset, dataLength);
if (prop.getPrivacy()) {
byte[] toProcess = new byte[dataLength + TOKEN_HEADER_SIZE];
System.arraycopy(data, dataOffset, toProcess, 0, dataLength);
encodeHeader(toProcess, dataLength);
tokenData = encryptor.encryptData(toProcess, getKeyUsage());
} else {
tokenData = data;
}
}