You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ac...@apache.org on 2018/09/21 06:04:39 UTC

[camel] branch master updated (444021a -> d68481b)

This is an automated email from the ASF dual-hosted git repository.

acosentino pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git.


    from 444021a  CAMEL-12816: CS fixes
     new 69a9ad4  [CAMEL-12605] Updated client integration tests
     new 64f050b  [CAMEL-12605] Fixed parsing issue with MultipartSignedEntityBody
     new d68481b  Camel-As2: Fixed CS

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../camel/component/as2/api/AS2ClientManager.java  | 18 ++--
 .../component/as2/api/entity/EntityParser.java     | 34 +++++---
 .../component/as2/api/util/AS2HeaderUtils.java     |  4 +-
 .../component/as2/api/util/HttpMessageUtils.java   |  5 +-
 .../src/main/docs/as2-component.adoc               |  4 +-
 .../camel/component/as2/AS2Configuration.java      | 13 +--
 .../as2/AS2ClientManagerIntegrationTest.java       | 96 ++++++++++++++++++++++
 .../as2/springboot/AS2ComponentConfiguration.java  | 14 ++--
 8 files changed, 151 insertions(+), 37 deletions(-)


[camel] 02/03: [CAMEL-12605] Fixed parsing issue with MultipartSignedEntityBody

Posted by ac...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

acosentino pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git

commit 64f050bc294174e680f4f3f32beedf1d75bc62bd
Author: William Collins <pu...@gmail.com>
AuthorDate: Thu Sep 20 13:45:59 2018 -0400

    [CAMEL-12605] Fixed parsing issue with MultipartSignedEntityBody
---
 .../component/as2/api/entity/EntityParser.java     | 34 +++++++++++++++-------
 .../component/as2/api/util/AS2HeaderUtils.java     |  4 +--
 .../component/as2/api/util/HttpMessageUtils.java   |  5 ++--
 3 files changed, 29 insertions(+), 14 deletions(-)

diff --git a/components/camel-as2/camel-as2-api/src/main/java/org/apache/camel/component/as2/api/entity/EntityParser.java b/components/camel-as2/camel-as2-api/src/main/java/org/apache/camel/component/as2/api/entity/EntityParser.java
index b2c3f46..60cee06 100644
--- a/components/camel-as2/camel-as2-api/src/main/java/org/apache/camel/component/as2/api/entity/EntityParser.java
+++ b/components/camel-as2/camel-as2-api/src/main/java/org/apache/camel/component/as2/api/entity/EntityParser.java
@@ -40,11 +40,13 @@ import org.apache.http.Header;
 import org.apache.http.HttpEntity;
 import org.apache.http.HttpException;
 import org.apache.http.HttpMessage;
+import org.apache.http.NameValuePair;
 import org.apache.http.ParseException;
 import org.apache.http.entity.ContentType;
 import org.apache.http.impl.io.AbstractMessageParser;
 import org.apache.http.impl.io.HttpTransportMetricsImpl;
 import org.apache.http.message.BasicLineParser;
+import org.apache.http.message.BasicNameValuePair;
 import org.apache.http.message.LineParser;
 import org.apache.http.message.ParserCursor;
 import org.apache.http.util.Args;
@@ -276,12 +278,18 @@ public final class EntityParser {
             inbuffer.bind(entity.getContent());
 
             // Get Boundary Value
-            String boundary = HttpMessageUtils.getBoundaryParameterValue(message, AS2Header.CONTENT_TYPE);
+            String boundary = HttpMessageUtils.getParameterValue(message, AS2Header.CONTENT_TYPE, "boundary");
             if (boundary == null) {
-                throw new HttpException("Failed to retrive boundary value");
+                throw new HttpException("Failed to retrieve 'boundary' parameter from content type header");
+            }
+            
+            // Get Micalg Value
+            String micalg = HttpMessageUtils.getParameterValue(message, AS2Header.CONTENT_TYPE, "micalg");
+            if (micalg == null) {
+                throw new HttpException("Failed to retrieve 'micalg' parameter from content type header");
             }
 
-            multipartSignedEntity = parseMultipartSignedEntityBody(inbuffer, boundary, charsetName, contentTransferEncoding);
+            multipartSignedEntity = parseMultipartSignedEntityBody(inbuffer, boundary, micalg, charsetName, contentTransferEncoding);
             multipartSignedEntity.setMainBody(true);
 
             EntityUtils.setMessageEntity(message, multipartSignedEntity);
@@ -370,7 +378,7 @@ public final class EntityParser {
             inbuffer.bind(entity.getContent());
 
             // Get Boundary Value
-            String boundary = HttpMessageUtils.getBoundaryParameterValue(message, AS2Header.CONTENT_TYPE);
+            String boundary = HttpMessageUtils.getParameterValue(message, AS2Header.CONTENT_TYPE, "boundary");
             if (boundary == null) {
                 throw new HttpException("Failed to retrive boundary value");
             }
@@ -420,6 +428,7 @@ public final class EntityParser {
 
     public static MultipartSignedEntity parseMultipartSignedEntityBody(AS2SessionInputBuffer inbuffer,
                                                                        String boundary,
+                                                                       String micalg,
                                                                        String charsetName,
                                                                        String contentTransferEncoding)
             throws ParseException {
@@ -514,7 +523,11 @@ public final class EntityParser {
             //
             // End Signature Body Part
 
-            ContentType contentType = ContentType.create(AS2MimeType.MULTIPART_SIGNED, charset);
+            NameValuePair[] parameters = new NameValuePair[] {
+                    new BasicNameValuePair("protocol", AS2MimeType.APPLICATION_PKCS7_SIGNATURE),
+                    new BasicNameValuePair("boundary", boundary), new BasicNameValuePair("micalg", micalg),
+                    new BasicNameValuePair("charset", charsetName)};
+            ContentType contentType = ContentType.create(AS2MimeType.MULTIPART_SIGNED, parameters);
             multipartSignedEntity.setContentType(contentType);
             multipartSignedEntity.setContentTransferEncoding(contentTransferEncoding);
             return multipartSignedEntity;
@@ -731,9 +744,10 @@ public final class EntityParser {
                 entity = parseEDIEntityBody(inbuffer, boundary, entityContentType, contentTransferEncoding);
                 break;
             case AS2MimeType.MULTIPART_SIGNED:
-                String multipartSignedBoundary = AS2HeaderUtils.getBoundaryParameterValue(headers,
-                        AS2Header.CONTENT_TYPE);
-                entity = parseMultipartSignedEntityBody(inbuffer, multipartSignedBoundary, charset.name(),
+                String multipartSignedBoundary = AS2HeaderUtils.getParameterValue(headers,
+                        AS2Header.CONTENT_TYPE, "boundary");
+                String micalg = AS2HeaderUtils.getParameterValue(headers, AS2Header.CONTENT_TYPE, "micalg");
+                entity = parseMultipartSignedEntityBody(inbuffer, multipartSignedBoundary, micalg, charset.name(),
                         contentTransferEncoding);
                 skipToBoundary(inbuffer, boundary);
                 break;
@@ -742,8 +756,8 @@ public final class EntityParser {
                         contentTransferEncoding);
                 break;
             case AS2MimeType.MULTIPART_REPORT:
-                String multipartReportBoundary = AS2HeaderUtils.getBoundaryParameterValue(headers,
-                        AS2Header.CONTENT_TYPE);
+                String multipartReportBoundary = AS2HeaderUtils.getParameterValue(headers,
+                        AS2Header.CONTENT_TYPE, "boundary");
                 entity = parseMultipartReportEntityBody(inbuffer, multipartReportBoundary, charset.name(),
                         contentTransferEncoding);
                 skipToBoundary(inbuffer, boundary);
diff --git a/components/camel-as2/camel-as2-api/src/main/java/org/apache/camel/component/as2/api/util/AS2HeaderUtils.java b/components/camel-as2/camel-as2-api/src/main/java/org/apache/camel/component/as2/api/util/AS2HeaderUtils.java
index 213183b..db589d5 100644
--- a/components/camel-as2/camel-as2-api/src/main/java/org/apache/camel/component/as2/api/util/AS2HeaderUtils.java
+++ b/components/camel-as2/camel-as2-api/src/main/java/org/apache/camel/component/as2/api/util/AS2HeaderUtils.java
@@ -145,14 +145,14 @@ public final class AS2HeaderUtils {
         return new Parameter(name, importance, values.toArray(new String[values.size()]));
     }
 
-    public static String getBoundaryParameterValue(Header[] headers, String headerName) {
+    public static String getParameterValue(Header[] headers, String headerName, String parameterName) {
         Args.notNull(headers, "headers");
         Args.notNull(headerName, "headerName");
         for (Header header : headers) {
             if (header.getName().equalsIgnoreCase(headerName)) {
                 for (HeaderElement headerElement : header.getElements()) {
                     for (NameValuePair nameValuePair : headerElement.getParameters()) {
-                        if (nameValuePair.getName().equalsIgnoreCase("boundary")) {
+                        if (nameValuePair.getName().equalsIgnoreCase(parameterName)) {
                             return nameValuePair.getValue();
                         }
                     }
diff --git a/components/camel-as2/camel-as2-api/src/main/java/org/apache/camel/component/as2/api/util/HttpMessageUtils.java b/components/camel-as2/camel-as2-api/src/main/java/org/apache/camel/component/as2/api/util/HttpMessageUtils.java
index 1563c7a..0bf4962 100644
--- a/components/camel-as2/camel-as2-api/src/main/java/org/apache/camel/component/as2/api/util/HttpMessageUtils.java
+++ b/components/camel-as2/camel-as2-api/src/main/java/org/apache/camel/component/as2/api/util/HttpMessageUtils.java
@@ -96,16 +96,17 @@ public final class HttpMessageUtils {
         }
     }
 
-    public static String getBoundaryParameterValue(HttpMessage message, String headerName) {
+    public static String getParameterValue(HttpMessage message, String headerName, String parameterName) {
         Args.notNull(message, "message");
         Args.notNull(headerName, "headerName");
+        Args.notNull(parameterName, "parameterName");
         Header header = message.getFirstHeader(headerName);
         if (header == null) {
             return null;
         }
         for (HeaderElement headerElement : header.getElements()) {
             for (NameValuePair nameValuePair : headerElement.getParameters()) {
-                if (nameValuePair.getName().equalsIgnoreCase("boundary")) {
+                if (nameValuePair.getName().equalsIgnoreCase(parameterName)) {
                     return nameValuePair.getValue();
                 }
             }


[camel] 03/03: Camel-As2: Fixed CS

Posted by ac...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

acosentino pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git

commit d68481b8974a4c8ec1a3fd6dbf5d20ed482537ea
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Fri Sep 21 08:03:48 2018 +0200

    Camel-As2: Fixed CS
---
 .../org/apache/camel/component/as2/api/entity/EntityParser.java     | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/components/camel-as2/camel-as2-api/src/main/java/org/apache/camel/component/as2/api/entity/EntityParser.java b/components/camel-as2/camel-as2-api/src/main/java/org/apache/camel/component/as2/api/entity/EntityParser.java
index 60cee06..fcb2431 100644
--- a/components/camel-as2/camel-as2-api/src/main/java/org/apache/camel/component/as2/api/entity/EntityParser.java
+++ b/components/camel-as2/camel-as2-api/src/main/java/org/apache/camel/component/as2/api/entity/EntityParser.java
@@ -524,9 +524,9 @@ public final class EntityParser {
             // End Signature Body Part
 
             NameValuePair[] parameters = new NameValuePair[] {
-                    new BasicNameValuePair("protocol", AS2MimeType.APPLICATION_PKCS7_SIGNATURE),
-                    new BasicNameValuePair("boundary", boundary), new BasicNameValuePair("micalg", micalg),
-                    new BasicNameValuePair("charset", charsetName)};
+                new BasicNameValuePair("protocol", AS2MimeType.APPLICATION_PKCS7_SIGNATURE),
+                new BasicNameValuePair("boundary", boundary), new BasicNameValuePair("micalg", micalg),
+                new BasicNameValuePair("charset", charsetName)};
             ContentType contentType = ContentType.create(AS2MimeType.MULTIPART_SIGNED, parameters);
             multipartSignedEntity.setContentType(contentType);
             multipartSignedEntity.setContentTransferEncoding(contentTransferEncoding);


[camel] 01/03: [CAMEL-12605] Updated client integration tests

Posted by ac...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

acosentino pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git

commit 69a9ad41394f66fdaf284fa764f329df5834e236
Author: William Collins <pu...@gmail.com>
AuthorDate: Thu Sep 20 09:43:51 2018 -0400

    [CAMEL-12605] Updated client integration tests
---
 .../camel/component/as2/api/AS2ClientManager.java  | 18 ++--
 .../src/main/docs/as2-component.adoc               |  4 +-
 .../camel/component/as2/AS2Configuration.java      | 13 +--
 .../as2/AS2ClientManagerIntegrationTest.java       | 96 ++++++++++++++++++++++
 .../as2/springboot/AS2ComponentConfiguration.java  | 14 ++--
 5 files changed, 122 insertions(+), 23 deletions(-)

diff --git a/components/camel-as2/camel-as2-api/src/main/java/org/apache/camel/component/as2/api/AS2ClientManager.java b/components/camel-as2/camel-as2-api/src/main/java/org/apache/camel/component/as2/api/AS2ClientManager.java
index c8eb044..c99f341 100644
--- a/components/camel-as2/camel-as2-api/src/main/java/org/apache/camel/component/as2/api/AS2ClientManager.java
+++ b/components/camel-as2/camel-as2-api/src/main/java/org/apache/camel/component/as2/api/AS2ClientManager.java
@@ -194,9 +194,9 @@ public class AS2ClientManager {
      * @param signingPrivateKey - the private key used to sign EDI message
      * @param dispositionNotificationTo - an RFC2822 address to request a receipt or <code>null</code> if no receipt requested
      * @param signedReceiptMicAlgorithms - the senders list of signing algorithms for signing receipt, in preferred order,  or <code>null</code> if requesting an unsigned receipt.
-     * @param encryptionAlgorithm - the algorithm used to encrypt the message or <code>null</code> if sending EDI message unencrypted
-     * @param encryptionCertificateChain - the chain of certificates used to encrypt the message or <code>null</code> if sending EDI message unencrypted
-     * @param encryptionPrivateKey - the private key used to encrypt EDI message
+     * @param encryptingAlgorithm - the algorithm used to encrypt the message or <code>null</code> if sending EDI message unencrypted
+     * @param encryptingCertificateChain - the chain of certificates used to encrypt the message or <code>null</code> if sending EDI message unencrypted
+     * @param encryptingPrivateKey - the private key used to encrypt EDI message
      * @return {@link HttpCoreContext} containing request and response used to send EDI message
      * @throws HttpException when things go wrong.
      */
@@ -213,9 +213,9 @@ public class AS2ClientManager {
                                 PrivateKey signingPrivateKey,
                                 String dispositionNotificationTo,
                                 String[] signedReceiptMicAlgorithms,
-                                AS2EncryptionAlgorithm encryptionAlgorithm,
-                                Certificate[] encryptionCertificateChain,
-                                PrivateKey encryptionPrivateKey)
+                                AS2EncryptionAlgorithm encryptingAlgorithm,
+                                Certificate[] encryptingCertificateChain,
+                                PrivateKey encryptingPrivateKey)
             throws HttpException {
 
         Args.notNull(ediMessage, "EDI Message");
@@ -237,9 +237,9 @@ public class AS2ClientManager {
         httpContext.setAttribute(AS2ClientManager.SIGNING_PRIVATE_KEY, signingPrivateKey);
         httpContext.setAttribute(AS2ClientManager.DISPOSITION_NOTIFICATION_TO, dispositionNotificationTo);
         httpContext.setAttribute(AS2ClientManager.SIGNED_RECEIPT_MIC_ALGORITHMS, signedReceiptMicAlgorithms);
-        httpContext.setAttribute(AS2ClientManager.ENCRYPTING_ALGORITHM, encryptionAlgorithm);
-        httpContext.setAttribute(AS2ClientManager.ENCRYPTING_CERTIFICATE_CHAIN, encryptionCertificateChain);
-        httpContext.setAttribute(AS2ClientManager.ENCRYPTING_PRIVATE_KEY, encryptionPrivateKey);
+        httpContext.setAttribute(AS2ClientManager.ENCRYPTING_ALGORITHM, encryptingAlgorithm);
+        httpContext.setAttribute(AS2ClientManager.ENCRYPTING_CERTIFICATE_CHAIN, encryptingCertificateChain);
+        httpContext.setAttribute(AS2ClientManager.ENCRYPTING_PRIVATE_KEY, encryptingPrivateKey);
 
         BasicHttpEntityEnclosingRequest request = new BasicHttpEntityEnclosingRequest("POST", requestUri);
         httpContext.setAttribute(HTTP_REQUEST, request);
diff --git a/components/camel-as2/camel-as2-component/src/main/docs/as2-component.adoc b/components/camel-as2/camel-as2-component/src/main/docs/as2-component.adoc
index 6a6705b..d4a4e2a 100644
--- a/components/camel-as2/camel-as2-component/src/main/docs/as2-component.adoc
+++ b/components/camel-as2/camel-as2-component/src/main/docs/as2-component.adoc
@@ -84,7 +84,7 @@ with the following path and query parameters:
 | *dispositionNotificationTo* (common) | The value of the Disposition-Notification-To header. Assigning a value to this parameter requests a message disposition notification (MDN) for the AS2 message. |  | String
 | *ediMessageTransferEncoding* (common) | The transfer encoding of EDI message. |  | String
 | *ediMessageType* (common) | The content type of EDI message. One of application/edifact, application/edi-x12, application/edi-consent |  | ContentType
-| *encryptingAlgorithmName* (common) | The name of algorithm used to encrypt EDI message. |  | String
+| *encryptingAlgorithm* (common) | The algorithm used to encrypt EDI message. |  | AS2EncryptionAlgorithm
 | *encryptingCertificateChain* (common) | The chain of certificates used to encrypt EDI message. |  | Certificate[]
 | *encryptingPrivateKey* (common) | The key used to encrypt the EDI message. |  | PrivateKey
 | *from* (common) | The value of the From header of AS2 message. |  | String
@@ -128,7 +128,7 @@ The component supports 28 options, which are listed below.
 | *camel.component.as2.configuration.disposition-notification-to* | The value of the Disposition-Notification-To header. Assigning a value to this parameter requests a message disposition notification (MDN) for the AS2 message. |  | String
 | *camel.component.as2.configuration.edi-message-transfer-encoding* | The transfer encoding of EDI message. |  | String
 | *camel.component.as2.configuration.edi-message-type* | The content type of EDI message. One of application/edifact, application/edi-x12, application/edi-consent |  | ContentType
-| *camel.component.as2.configuration.encrypting-algorithm-name* | The name of algorithm used to encrypt EDI message. |  | String
+| *camel.component.as2.configuration.encrypting-algorithm* | The algorithm used to encrypt EDI message. |  | AS2EncryptionAlgorithm
 | *camel.component.as2.configuration.encrypting-certificate-chain* | The chain of certificates used to encrypt EDI message. |  | Certificate[]
 | *camel.component.as2.configuration.encrypting-private-key* | The key used to encrypt the EDI message. |  | PrivateKey
 | *camel.component.as2.configuration.from* | The value of the From header of AS2 message. |  | String
diff --git a/components/camel-as2/camel-as2-component/src/main/java/org/apache/camel/component/as2/AS2Configuration.java b/components/camel-as2/camel-as2-component/src/main/java/org/apache/camel/component/as2/AS2Configuration.java
index b819c5a..73bc0fe 100644
--- a/components/camel-as2/camel-as2-component/src/main/java/org/apache/camel/component/as2/AS2Configuration.java
+++ b/components/camel-as2/camel-as2-component/src/main/java/org/apache/camel/component/as2/AS2Configuration.java
@@ -20,6 +20,7 @@ import java.security.PrivateKey;
 import java.security.cert.Certificate;
 
 import org.apache.camel.RuntimeCamelException;
+import org.apache.camel.component.as2.api.AS2EncryptionAlgorithm;
 import org.apache.camel.component.as2.api.AS2MessageStructure;
 import org.apache.camel.component.as2.internal.AS2ApiName;
 import org.apache.camel.spi.Metadata;
@@ -106,7 +107,7 @@ public class AS2Configuration {
     private String[] signedReceiptMicAlgorithms;
 
     @UriParam
-    private String encryptingAlgorithmName;
+    private AS2EncryptionAlgorithm encryptingAlgorithm;
 
     @UriParam
     private Certificate[] encryptingCertificateChain;
@@ -413,15 +414,15 @@ public class AS2Configuration {
         this.signedReceiptMicAlgorithms = signedReceiptMicAlgorithms;
     }
 
-    public String getEncryptingingAlgorithmName() {
-        return signingAlgorithmName;
+    public AS2EncryptionAlgorithm getEncryptingingAlgorithm() {
+        return encryptingAlgorithm;
     }
 
     /**
-     * The name of algorithm used to encrypt EDI message.
+     * The algorithm used to encrypt EDI message.
      */
-    public void setEncryptingAlgorithmName(String signingAlgorithmName) {
-        this.encryptingAlgorithmName = signingAlgorithmName;
+    public void setEncryptingAlgorithm(AS2EncryptionAlgorithm encryptingAlgorithm) {
+        this.encryptingAlgorithm = encryptingAlgorithm;
     }
 
     public Certificate[] getEncryptingCertificateChain() {
diff --git a/components/camel-as2/camel-as2-component/src/test/java/org/apache/camel/component/as2/AS2ClientManagerIntegrationTest.java b/components/camel-as2/camel-as2-component/src/test/java/org/apache/camel/component/as2/AS2ClientManagerIntegrationTest.java
index 75b1e10..58ad275 100644
--- a/components/camel-as2/camel-as2-component/src/test/java/org/apache/camel/component/as2/AS2ClientManagerIntegrationTest.java
+++ b/components/camel-as2/camel-as2-component/src/test/java/org/apache/camel/component/as2/AS2ClientManagerIntegrationTest.java
@@ -32,6 +32,7 @@ import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.component.as2.api.AS2AsynchronousMDNManager;
 import org.apache.camel.component.as2.api.AS2Charset;
 import org.apache.camel.component.as2.api.AS2Constants;
+import org.apache.camel.component.as2.api.AS2EncryptionAlgorithm;
 import org.apache.camel.component.as2.api.AS2Header;
 import org.apache.camel.component.as2.api.AS2MediaType;
 import org.apache.camel.component.as2.api.AS2MessageStructure;
@@ -43,6 +44,7 @@ import org.apache.camel.component.as2.api.entity.AS2DispositionModifier;
 import org.apache.camel.component.as2.api.entity.AS2DispositionType;
 import org.apache.camel.component.as2.api.entity.AS2MessageDispositionNotificationEntity;
 import org.apache.camel.component.as2.api.entity.ApplicationEDIEntity;
+import org.apache.camel.component.as2.api.entity.ApplicationPkcs7MimeEntity;
 import org.apache.camel.component.as2.api.entity.ApplicationPkcs7SignatureEntity;
 import org.apache.camel.component.as2.api.entity.DispositionMode;
 import org.apache.camel.component.as2.api.entity.DispositionNotificationMultipartReportEntity;
@@ -227,6 +229,12 @@ public class AS2ClientManagerIntegrationTest extends AbstractAS2TestSupport {
         headers.put("CamelAS2.dispositionNotificationTo", "mrAS2@example.com");
         // parameter type is String[]
         headers.put("CamelAS2.signedReceiptMicAlgorithms", null);
+        // parameter type is org.apache.camel.component.as2.api.AS2EncryptionAlgorithm
+        headers.put("CamelAS2.encryptingAlgorithm", null);
+        // parameter type is java.security.cert.Certificate[]
+        headers.put("CamelAS2.encryptingCertificateChain", null);
+        // parameter type is java.security.PrivateKey
+        headers.put("CamelAS2.encryptingPrivateKey", null);
 
         final org.apache.http.protocol.HttpCoreContext result = requestBodyAndHeaders("direct://SEND", EDI_MESSAGE, headers);
 
@@ -275,6 +283,88 @@ public class AS2ClientManagerIntegrationTest extends AbstractAS2TestSupport {
     }
 
     @Test
+    public void envelopedMessageSendTest() throws Exception {
+        final Map<String, Object> headers = new HashMap<>();
+        // parameter type is String
+        headers.put("CamelAS2.requestUri", REQUEST_URI);
+        // parameter type is String
+        headers.put("CamelAS2.subject", SUBJECT);
+        // parameter type is String
+        headers.put("CamelAS2.from", FROM);
+        // parameter type is String
+        headers.put("CamelAS2.as2From", AS2_NAME);
+        // parameter type is String
+        headers.put("CamelAS2.as2To", AS2_NAME);
+        // parameter type is org.apache.camel.component.as2.api.AS2MessageStructure
+        headers.put("CamelAS2.as2MessageStructure", AS2MessageStructure.ENCRYPTED);
+        // parameter type is org.apache.http.entity.ContentType
+        headers.put("CamelAS2.ediMessageContentType", ContentType.create(AS2MediaType.APPLICATION_EDIFACT, AS2Charset.US_ASCII));
+        // parameter type is String
+        headers.put("CamelAS2.ediMessageTransferEncoding", EDI_MESSAGE_CONTENT_TRANSFER_ENCODING);
+        // parameter type is java.security.cert.Certificate[]
+        headers.put("CamelAS2.signingCertificateChain", null);
+        // parameter type is java.security.PrivateKey
+        headers.put("CamelAS2.signingPrivateKey", null);
+        // parameter type is String
+        headers.put("CamelAS2.dispositionNotificationTo", "mrAS2@example.com");
+        // parameter type is String[]
+        headers.put("CamelAS2.signedReceiptMicAlgorithms", null);
+        // parameter type is org.apache.camel.component.as2.api.AS2EncryptionAlgorithm
+        headers.put("CamelAS2.encryptingAlgorithm", AS2EncryptionAlgorithm.AES128_CBC);
+        // parameter type is java.security.cert.Certificate[]
+        headers.put("CamelAS2.encryptingCertificateChain", certList);
+        // parameter type is java.security.PrivateKey
+        headers.put("CamelAS2.encryptingPrivateKey", signingKP.getPrivate());
+
+        final org.apache.http.protocol.HttpCoreContext result = requestBodyAndHeaders("direct://SEND", EDI_MESSAGE, headers);
+
+        assertNotNull("send result", result);
+        LOG.debug("send: " + result);
+        HttpRequest request = result.getRequest();
+        assertNotNull("Request", request);
+        assertTrue("Request does not contain body", request instanceof HttpEntityEnclosingRequest);
+        HttpEntity entity = ((HttpEntityEnclosingRequest)request).getEntity();
+        assertNotNull("Request body", entity);
+        assertTrue("Request body does not contain ApplicationPkcs7Mime entity", entity instanceof ApplicationPkcs7MimeEntity);
+        MimeEntity envelopeEntity = ((ApplicationPkcs7MimeEntity)entity).getEncryptedEntity(signingKP.getPrivate());
+        assertTrue("Enveloped entity is not an EDI entity", envelopeEntity instanceof ApplicationEDIEntity);
+        String ediMessage = ((ApplicationEDIEntity)envelopeEntity).getEdiMessage();
+        assertEquals("EDI message is different", EDI_MESSAGE.replaceAll("[\n\r]", ""), ediMessage.replaceAll("[\n\r]", ""));
+
+        HttpResponse response = result.getResponse();
+        assertNotNull("Response", response);
+        assertTrue("Unexpected response type", HttpMessageUtils.getHeaderValue(response, AS2Header.CONTENT_TYPE).startsWith(AS2MimeType.MULTIPART_REPORT));
+        assertEquals("Unexpected mime version", AS2Constants.MIME_VERSION, HttpMessageUtils.getHeaderValue(response, AS2Header.MIME_VERSION));
+        assertEquals("Unexpected AS2 version", EXPECTED_AS2_VERSION, HttpMessageUtils.getHeaderValue(response, AS2Header.AS2_VERSION));
+        assertEquals("Unexpected MDN subject", EXPECTED_MDN_SUBJECT, HttpMessageUtils.getHeaderValue(response, AS2Header.SUBJECT));
+        assertEquals("Unexpected MDN from", MDN_FROM, HttpMessageUtils.getHeaderValue(response, AS2Header.FROM));
+        assertEquals("Unexpected AS2 from", AS2_NAME, HttpMessageUtils.getHeaderValue(response, AS2Header.AS2_FROM));
+        assertEquals("Unexpected AS2 to", AS2_NAME, HttpMessageUtils.getHeaderValue(response, AS2Header.AS2_TO));
+        assertNotNull("Missing message id", HttpMessageUtils.getHeaderValue(response, AS2Header.MESSAGE_ID));
+
+        HttpEntity responseEntity = response.getEntity();
+        assertNotNull("Response entity", responseEntity);
+        assertTrue("Unexpected response entity type", responseEntity instanceof DispositionNotificationMultipartReportEntity);
+        DispositionNotificationMultipartReportEntity reportEntity = (DispositionNotificationMultipartReportEntity)responseEntity;
+        assertEquals("Unexpected number of body parts in report", 2, reportEntity.getPartCount());
+        MimeEntity firstPart = reportEntity.getPart(0);
+        assertEquals("Unexpected content type in first body part of report", ContentType.create(AS2MimeType.TEXT_PLAIN, AS2Charset.US_ASCII).toString(), firstPart.getContentTypeValue());
+        MimeEntity secondPart = reportEntity.getPart(1);
+        assertEquals("Unexpected content type in second body part of report",
+                ContentType.create(AS2MimeType.MESSAGE_DISPOSITION_NOTIFICATION, AS2Charset.US_ASCII).toString(),
+                secondPart.getContentTypeValue());
+        
+        assertTrue("", secondPart instanceof AS2MessageDispositionNotificationEntity);
+        AS2MessageDispositionNotificationEntity messageDispositionNotificationEntity = (AS2MessageDispositionNotificationEntity) secondPart;
+        assertEquals("Unexpected value for reporting UA", ORIGIN_SERVER_NAME, messageDispositionNotificationEntity.getReportingUA());
+        assertEquals("Unexpected value for final recipient", AS2_NAME, messageDispositionNotificationEntity.getFinalRecipient());
+        assertEquals("Unexpected value for original message ID", HttpMessageUtils.getHeaderValue(request, AS2Header.MESSAGE_ID), messageDispositionNotificationEntity.getOriginalMessageId());
+        assertEquals("Unexpected value for disposition mode", DispositionMode.AUTOMATIC_ACTION_MDN_SENT_AUTOMATICALLY, messageDispositionNotificationEntity.getDispositionMode());
+        assertEquals("Unexpected value for disposition type", AS2DispositionType.PROCESSED, messageDispositionNotificationEntity.getDispositionType());
+        
+    }
+
+    @Test
     public void multipartSignedMessageTest() throws Exception {
         final Map<String, Object> headers = new HashMap<>();
         // parameter type is String
@@ -301,6 +391,12 @@ public class AS2ClientManagerIntegrationTest extends AbstractAS2TestSupport {
         headers.put("CamelAS2.dispositionNotificationTo", "mrAS2@example.com");
         // parameter type is String[]
         headers.put("CamelAS2.signedReceiptMicAlgorithms", SIGNED_RECEIPT_MIC_ALGORITHMS);
+        // parameter type is org.apache.camel.component.as2.api.AS2EncryptionAlgorithm
+        headers.put("CamelAS2.encryptingAlgorithm", null);
+        // parameter type is java.security.cert.Certificate[]
+        headers.put("CamelAS2.encryptingCertificateChain", null);
+        // parameter type is java.security.PrivateKey
+        headers.put("CamelAS2.encryptingPrivateKey", null);
 
         final org.apache.http.protocol.HttpCoreContext result = requestBodyAndHeaders("direct://SEND", EDI_MESSAGE, headers);
 
diff --git a/platforms/spring-boot/components-starter/camel-as2-starter/src/main/java/org/apache/camel/component/as2/springboot/AS2ComponentConfiguration.java b/platforms/spring-boot/components-starter/camel-as2-starter/src/main/java/org/apache/camel/component/as2/springboot/AS2ComponentConfiguration.java
index 27ddc9b..0f65e1b 100644
--- a/platforms/spring-boot/components-starter/camel-as2-starter/src/main/java/org/apache/camel/component/as2/springboot/AS2ComponentConfiguration.java
+++ b/platforms/spring-boot/components-starter/camel-as2-starter/src/main/java/org/apache/camel/component/as2/springboot/AS2ComponentConfiguration.java
@@ -19,6 +19,7 @@ package org.apache.camel.component.as2.springboot;
 import java.security.PrivateKey;
 import java.security.cert.Certificate;
 import javax.annotation.Generated;
+import org.apache.camel.component.as2.api.AS2EncryptionAlgorithm;
 import org.apache.camel.component.as2.api.AS2MessageStructure;
 import org.apache.camel.component.as2.internal.AS2ApiName;
 import org.apache.camel.spring.boot.ComponentConfigurationPropertiesCommon;
@@ -177,9 +178,9 @@ public class AS2ComponentConfiguration
          */
         private String[] signedReceiptMicAlgorithms;
         /**
-         * The name of algorithm used to encrypt EDI message.
+         * The algorithm used to encrypt EDI message.
          */
-        private String encryptingAlgorithmName;
+        private AS2EncryptionAlgorithm encryptingAlgorithm;
         /**
          * The chain of certificates used to encrypt EDI message.
          */
@@ -378,12 +379,13 @@ public class AS2ComponentConfiguration
             this.signedReceiptMicAlgorithms = signedReceiptMicAlgorithms;
         }
 
-        public String getEncryptingAlgorithmName() {
-            return encryptingAlgorithmName;
+        public AS2EncryptionAlgorithm getEncryptingAlgorithm() {
+            return encryptingAlgorithm;
         }
 
-        public void setEncryptingAlgorithmName(String encryptingAlgorithmName) {
-            this.encryptingAlgorithmName = encryptingAlgorithmName;
+        public void setEncryptingAlgorithm(
+                AS2EncryptionAlgorithm encryptingAlgorithm) {
+            this.encryptingAlgorithm = encryptingAlgorithm;
         }
 
         public Certificate[] getEncryptingCertificateChain() {