diff --git a/pom.xml b/pom.xml
index 5c10238..dad4180 100755
--- a/pom.xml
+++ b/pom.xml
@@ -32,7 +32,7 @@
oxalis-as4
- 4.1.2
+ 4.1.3
jar
diff --git a/src/main/java/no/difi/oxalis/as4/inbound/AbstractSetPolicyInterceptor.java b/src/main/java/no/difi/oxalis/as4/inbound/AbstractSetPolicyInterceptor.java
index 4471c6c..d568c8f 100644
--- a/src/main/java/no/difi/oxalis/as4/inbound/AbstractSetPolicyInterceptor.java
+++ b/src/main/java/no/difi/oxalis/as4/inbound/AbstractSetPolicyInterceptor.java
@@ -10,7 +10,6 @@
import org.apache.cxf.interceptor.Fault;
import org.apache.cxf.message.Message;
import org.apache.cxf.ws.policy.PolicyConstants;
-import org.apache.cxf.ws.policy.PolicyInInterceptor;
import org.apache.neethi.Policy;
import org.oasis_open.docs.ebxml_msg.ebms.v3_0.ns.core._200704.Messaging;
import org.oasis_open.docs.ebxml_msg.ebms.v3_0.ns.core._200704.UserMessage;
@@ -23,6 +22,8 @@
import java.util.Optional;
import java.util.stream.Stream;
+import static org.apache.cxf.ws.security.SecurityConstants.USE_ATTACHMENT_ENCRYPTION_CONTENT_ONLY_TRANSFORM;
+
@Slf4j
abstract class AbstractSetPolicyInterceptor extends AbstractSoapInterceptor {
@@ -36,6 +37,8 @@ public AbstractSetPolicyInterceptor(String phase, PolicyService policyService) {
@Override
public void handleMessage(SoapMessage message) throws Fault {
+ message.put(USE_ATTACHMENT_ENCRYPTION_CONTENT_ONLY_TRANSFORM, true);
+
Optional userMessage = getMessaging(message)
.map(Messaging::getUserMessage)
.map(Collection::stream).orElseGet(Stream::empty)
diff --git a/src/main/java/no/difi/oxalis/as4/inbound/SetPolicyOutInterceptor.java b/src/main/java/no/difi/oxalis/as4/inbound/SetPolicyOutInterceptor.java
index f8fae4f..0ca16a4 100644
--- a/src/main/java/no/difi/oxalis/as4/inbound/SetPolicyOutInterceptor.java
+++ b/src/main/java/no/difi/oxalis/as4/inbound/SetPolicyOutInterceptor.java
@@ -3,29 +3,9 @@
import com.google.inject.Inject;
import com.google.inject.Singleton;
import lombok.extern.slf4j.Slf4j;
-import no.difi.oxalis.as4.util.Constants;
-import no.difi.oxalis.as4.util.Marshalling;
import no.difi.oxalis.as4.util.PolicyService;
-import org.apache.cxf.binding.soap.SoapMessage;
-import org.apache.cxf.binding.soap.interceptor.AbstractSoapInterceptor;
-import org.apache.cxf.headers.Header;
-import org.apache.cxf.interceptor.Fault;
-import org.apache.cxf.message.Message;
import org.apache.cxf.phase.Phase;
-import org.apache.cxf.ws.policy.PolicyConstants;
-import org.apache.cxf.ws.policy.PolicyInInterceptor;
import org.apache.cxf.ws.policy.PolicyOutInterceptor;
-import org.apache.neethi.Policy;
-import org.oasis_open.docs.ebxml_msg.ebms.v3_0.ns.core._200704.Messaging;
-import org.oasis_open.docs.ebxml_msg.ebms.v3_0.ns.core._200704.UserMessage;
-import org.w3c.dom.Node;
-
-import javax.xml.bind.JAXBContext;
-import javax.xml.bind.JAXBException;
-import javax.xml.bind.Unmarshaller;
-import java.util.Collection;
-import java.util.Optional;
-import java.util.stream.Stream;
@Slf4j
@Singleton
diff --git a/src/main/java/no/difi/oxalis/as4/outbound/As4MessageSender.java b/src/main/java/no/difi/oxalis/as4/outbound/As4MessageSender.java
index dbc00b2..4aa84ff 100644
--- a/src/main/java/no/difi/oxalis/as4/outbound/As4MessageSender.java
+++ b/src/main/java/no/difi/oxalis/as4/outbound/As4MessageSender.java
@@ -41,6 +41,7 @@
import static no.difi.oxalis.as4.common.AS4Constants.CEF_CONFORMANCE;
import static org.apache.cxf.rt.security.SecurityConstants.*;
+import static org.apache.cxf.ws.security.SecurityConstants.USE_ATTACHMENT_ENCRYPTION_CONTENT_ONLY_TRANSFORM;
@Slf4j
public class As4MessageSender {
@@ -117,6 +118,7 @@ private void configureSecurity(TransmissionRequest request, Dispatch prepareAttachments(TransmissionRequest request) throws OxalisAs4TransmissionException {