String ekId = context.generateID();
ek = elementFactory.createEncryptedKey(ekId,keyEncAlgo,ekKI,dkEncKey,dataEncKey);
context.getSecurityHeader().add((SecurityHeaderElement)ek);
xtbResult.setKeyInfo(null);
DirectReference dr = elementFactory.createDirectReference();
dr.setURI("#"+ekId);
boolean wss11Sender = "true".equals(context.getExtraneousProperty("EnableWSS11PolicySender"));
if(wss11Sender){
dr.setValueType(MessageConstants.EncryptedKey_NS);
}
SecurityTokenReference str = elementFactory.createSecurityTokenReference(dr);
keyInfo = elementFactory.createKeyInfo(str);
xtbResult.setKeyInfo(keyInfo);