" </sp:AlgorithmSuite>\n" +
"</wsp:Policy>\n" +
"</sp:AsymmetricBinding>";
PolicyEnforcer policyEnforcer = buildAndStartPolicyEngine(policyString);
RelTokenSecurityEvent initiatorTokenSecurityEvent = new RelTokenSecurityEvent();
initiatorTokenSecurityEvent.setIssuerName("xs:anyURI");
X509SecurityTokenImpl securityToken = getX509Token(WSSecurityTokenConstants.X509V3Token);
securityToken.addTokenUsage(WSSecurityTokenConstants.TokenUsage_MainSignature);
initiatorTokenSecurityEvent.setSecurityToken(securityToken);
policyEnforcer.registerSecurityEvent(initiatorTokenSecurityEvent);
RelTokenSecurityEvent recipientTokenSecurityEvent = new RelTokenSecurityEvent();
recipientTokenSecurityEvent.setIssuerName("xs:anyURI");
securityToken = getX509Token(WSSecurityTokenConstants.X509V3Token);
securityToken.addTokenUsage(WSSecurityTokenConstants.TokenUsage_MainEncryption);
recipientTokenSecurityEvent.setSecurityToken(securityToken);
policyEnforcer.registerSecurityEvent(recipientTokenSecurityEvent);
List<XMLSecurityConstants.ContentType> protectionOrder = new LinkedList<XMLSecurityConstants.ContentType>();
protectionOrder.add(XMLSecurityConstants.ContentType.SIGNATURE);
protectionOrder.add(XMLSecurityConstants.ContentType.ENCRYPTION);
SignedPartSecurityEvent signedPartSecurityEvent =
new SignedPartSecurityEvent(
(InboundSecurityToken)recipientTokenSecurityEvent.getSecurityToken(), true, protectionOrder);
signedPartSecurityEvent.setElementPath(WSSConstants.SOAP_11_BODY_PATH);
policyEnforcer.registerSecurityEvent(signedPartSecurityEvent);
ContentEncryptedElementSecurityEvent contentEncryptedElementSecurityEvent =
new ContentEncryptedElementSecurityEvent(
(InboundSecurityToken)recipientTokenSecurityEvent.getSecurityToken(), true, protectionOrder);
contentEncryptedElementSecurityEvent.setElementPath(WSSConstants.SOAP_11_BODY_PATH);
policyEnforcer.registerSecurityEvent(contentEncryptedElementSecurityEvent);
OperationSecurityEvent operationSecurityEvent = new OperationSecurityEvent();
operationSecurityEvent.setOperation(new QName("definitions"));