.next().getAssertion();
Policy pol = tok.getBootstrapPolicy();
if (s.endsWith("Cancel") || s.endsWith("/Renew")) {
//Cancel and Renew just sign with the token
Policy p = new Policy();
ExactlyOne ea = new ExactlyOne();
p.addPolicyComponent(ea);
All all = new All();
PolicyAssertion ass = SecureConversationTokenInterceptorProvider
.getAddressingPolicy(aim, false);
all.addPolicyComponent(ass);
ea.addPolicyComponent(all);
PolicyBuilder pbuilder = message.getExchange().getBus()
.getExtension(PolicyBuilder.class);
SymmetricBinding binding = new SymmetricBinding(SP12Constants.INSTANCE, pbuilder);
binding.setIncludeTimestamp(true);
ProtectionToken token = new ProtectionToken(SP12Constants.INSTANCE, pbuilder);
token.setToken(new SecureConversationToken(SP12Constants.INSTANCE));
binding.setProtectionToken(token);
binding.setEntireHeadersAndBodySignatures(true);
Binding origBinding = getBinding(aim);
binding.setAlgorithmSuite(origBinding.getAlgorithmSuite());
all.addPolicyComponent(binding);
SignedEncryptedParts parts = new SignedEncryptedParts(true,
SP12Constants.INSTANCE);
parts.setBody(true);
if (addNs != null) {
parts.addHeader(new Header("To", addNs));
parts.addHeader(new Header("From", addNs));
parts.addHeader(new Header("FaultTo", addNs));
parts.addHeader(new Header("ReplyTO", addNs));
parts.addHeader(new Header("MessageID", addNs));
parts.addHeader(new Header("RelatesTo", addNs));
parts.addHeader(new Header("Action", addNs));
}
all.addPolicyComponent(parts);
pol = p;
message.getInterceptorChain().add(SecureConversationTokenFinderInterceptor.INSTANCE);
} else {
Policy p = new Policy();
ExactlyOne ea = new ExactlyOne();
p.addPolicyComponent(ea);
All all = new All();
PolicyAssertion ass = SecureConversationTokenInterceptorProvider
.getAddressingPolicy(aim, false);
all.addPolicyComponent(ass);
ea.addPolicyComponent(all);
pol = p.merge(pol);
}
//setup SCT endpoint and forward to it.
unmapSecurityProps(message);