Assertion ass = NegotiationUtils.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);
SecureConversationToken scToken =
new SecureConversationToken(SP12Constants.INSTANCE);
scToken.setInclusion(SP12Constants.IncludeTokenType.INCLUDE_TOKEN_ALWAYS_TO_RECIPIENT);
token.setToken(scToken);
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);