"</sp:SymmetricBinding>";
PolicyEnforcer policyEnforcer = buildAndStartPolicyEngine(policyString);
UsernameTokenSecurityEvent initiatorTokenSecurityEvent = new UsernameTokenSecurityEvent();
initiatorTokenSecurityEvent.setUsernameTokenProfile(WSSConstants.NS_USERNAMETOKEN_PROFILE11);
UsernameSecurityTokenImpl securityToken = new UsernameSecurityTokenImpl(
WSSConstants.UsernameTokenPasswordType.PASSWORD_DIGEST,
"username", "password", new Date().toString(), null, new byte[10], 10L,
null, IDGenerator.generateID(null), WSSecurityTokenConstants.KeyIdentifier_SecurityTokenDirectReference);
securityToken.addTokenUsage(WSSecurityTokenConstants.TokenUsage_MainSignature);
initiatorTokenSecurityEvent.setSecurityToken(securityToken);
policyEnforcer.registerSecurityEvent(initiatorTokenSecurityEvent);
UsernameTokenSecurityEvent recipientTokenSecurityEvent = new UsernameTokenSecurityEvent();
recipientTokenSecurityEvent.setUsernameTokenProfile(WSSConstants.NS_USERNAMETOKEN_PROFILE11);
securityToken = new UsernameSecurityTokenImpl(
WSSConstants.UsernameTokenPasswordType.PASSWORD_DIGEST,
"username", "password", new Date().toString(), null, new byte[10], 10L,
null, IDGenerator.generateID(null), WSSecurityTokenConstants.KeyIdentifier_SecurityTokenDirectReference);
securityToken.addTokenUsage(WSSecurityTokenConstants.TokenUsage_MainEncryption);
recipientTokenSecurityEvent.setSecurityToken(securityToken);
policyEnforcer.registerSecurityEvent(recipientTokenSecurityEvent);
List<XMLSecurityConstants.ContentType> protectionOrder = new LinkedList<XMLSecurityConstants.ContentType>();
protectionOrder.add(XMLSecurityConstants.ContentType.SIGNATURE);