Search in sources :

Example 6 with SignedParts

use of org.apache.wss4j.policy.model.SignedParts in project cxf by apache.

the class SecureConversationInInterceptor method getSignedParts.

private SignedParts getSignedParts(AssertionInfoMap aim, String addNs) {
    AssertionInfo signedPartsAi = PolicyUtils.getFirstAssertionByLocalname(aim, SPConstants.SIGNED_PARTS);
    SignedParts signedParts = null;
    if (signedPartsAi != null) {
        signedParts = (SignedParts) signedPartsAi.getAssertion();
    }
    if (signedParts == null) {
        List<Header> headers = new ArrayList<>();
        if (addNs != null) {
            headers.add(new Header("To", addNs));
            headers.add(new Header("From", addNs));
            headers.add(new Header("FaultTo", addNs));
            headers.add(new Header("ReplyTo", addNs));
            headers.add(new Header("Action", addNs));
            headers.add(new Header("MessageID", addNs));
            headers.add(new Header("RelatesTo", addNs));
        }
        signedParts = new SignedParts(SPConstants.SPVersion.SP12, true, null, headers, false);
    }
    return signedParts;
}
Also used : AssertionInfo(org.apache.cxf.ws.policy.AssertionInfo) Header(org.apache.wss4j.policy.model.Header) ArrayList(java.util.ArrayList) SignedParts(org.apache.wss4j.policy.model.SignedParts)

Aggregations

SignedParts (org.apache.wss4j.policy.model.SignedParts)6 ArrayList (java.util.ArrayList)5 Header (org.apache.wss4j.policy.model.Header)5 AssertionInfo (org.apache.cxf.ws.policy.AssertionInfo)3 All (org.apache.neethi.All)3 ExactlyOne (org.apache.neethi.ExactlyOne)3 Policy (org.apache.neethi.Policy)3 ProtectionToken (org.apache.wss4j.policy.model.ProtectionToken)3 QName (javax.xml.namespace.QName)2 PrimitiveAssertion (org.apache.cxf.ws.policy.builder.primitive.PrimitiveAssertion)2 DefaultSymmetricBinding (org.apache.cxf.ws.security.trust.DefaultSymmetricBinding)2 Attachments (org.apache.wss4j.policy.model.Attachments)2 SecureConversationToken (org.apache.wss4j.policy.model.SecureConversationToken)2 SignedElements (org.apache.wss4j.policy.model.SignedElements)2 ExtensibilityElement (javax.wsdl.extensions.ExtensibilityElement)1 SOAPHeader (javax.xml.soap.SOAPHeader)1 DOMSource (javax.xml.transform.dom.DOMSource)1 ModCountCopyOnWriteArrayList (org.apache.cxf.common.util.ModCountCopyOnWriteArrayList)1 BindingOperationInfo (org.apache.cxf.service.model.BindingOperationInfo)1 W3CDOMStreamWriter (org.apache.cxf.staxutils.W3CDOMStreamWriter)1