protected void doResults(SoapMessage msg, String actor,
SOAPMessage doc, Vector results, boolean utWithCallbacks)
throws SOAPException, XMLStreamException, WSSecurityException {
AssertionInfoMap aim = msg.get(AssertionInfoMap.class);
Collection<WSDataRef> signed = new HashSet<WSDataRef>();
Collection<WSDataRef> encrypted = new HashSet<WSDataRef>();
Boolean hasDerivedKeys = null;
boolean hasEndorsement = false;
Protections prots = Protections.NONE;
for (int j = 0; j < results.size(); j++) {
WSSecurityEngineResult wser =
(WSSecurityEngineResult) results.get(j);
Integer actInt = (Integer)wser.get(WSSecurityEngineResult.TAG_ACTION);
switch (actInt.intValue()) {
case WSConstants.SIGN:
if (hasDerivedKeys == null) {
hasDerivedKeys = Boolean.FALSE;
}
List<WSDataRef> sl = CastUtils.cast((List<?>)wser
.get(WSSecurityEngineResult.TAG_DATA_REF_URIS));
if (sl != null) {
if (sl.size() == 1
&& sl.get(0).getName().equals(new QName(WSConstants.SIG_NS, WSConstants.SIG_LN))) {
//endorsing the signature
hasEndorsement = true;
break;
}
for (WSDataRef r : sl) {
signed.add(r);
}
prots = addSign(prots);
}
break;
case WSConstants.ENCR:
if (hasDerivedKeys == null) {
hasDerivedKeys = Boolean.FALSE;
}
List<WSDataRef> el = CastUtils.cast((List<?>)wser
.get(WSSecurityEngineResult.TAG_DATA_REF_URIS));
if (el != null) {
for (WSDataRef r : el) {
encrypted.add(r);
}
prots = addEncrypt(prots);
}
break;
case WSConstants.UT:
Collection<AssertionInfo> ais = aim.get(SP12Constants.USERNAME_TOKEN);
if (ais != null) {
for (AssertionInfo ai : ais) {
ai.setAsserted(true);
}