# AS2 Protocol 🚀

This section explains how to configure the Data Mover Smart to **receive AS2 messages** from a sending partner. AS2 messages contain a file and other elements. The AS2 message is signed by the sender and decrypted by the recipient.

The AS2 Protocol requires a specific license.&#x20;

{% hint style="info" %}
**Note:** To configure the Data Mover Smart for **sending AS2 Messages** to a receiving partner, you must create a Custom Connection [AS2](https://docs.primeur.com/data-mover-smart/links/custom-connection#as2) link and then use the [Push to remote](https://docs.primeur.com/data-mover-smart/rules/rules/actions/push-to-remote) action to send AS2 Messages.
{% endhint %}

Both the sender and the receiver of the AS2 Messages must be configured as **Partners**, and a **Partnership** must be created to link them. The Partnership must specify the security configurations used in the connection between the sender and the receiver (e.g., keys, certificates, signatures, encryption, VFS).

The sender may optionally request that the receiver sends back an MDN (Message Disposition Notification). The MDN is handled **exclusively in synchronous mode** in Data Mover Smart.

To configure the Data Mover Smart to **receive AS2 Messages from a sending partner**:

1. Go to **Services** → **Servers**.
2. Click **New**. &#x20;
3. In the **New server** panel select **AS2**.&#x20;
4. Fill in the fields below. Fields marked with **(\*)** are mandatory:
   * **Name (\*)**: enter a name for the server; it will appear in the server card or list.
   * **Port (\*)**: enter the server port.
   * **🚀 DMZ**: activate the DMZ toggle to use the DMZ, choose Port Forwarding mode and specify the port. This will add a new entry in the DMZ → [Servers](https://docs.primeur.com/data-mover-smart/dmz#servers) panel.
   * **Path (\*)**: servlet path where the AS2 message is received. Default /as2.
   * **Description**: optional description shown in the server card or row.
   * **VFS (\*)**: select the VFS where files will be stored.&#x20;
   * **Enabled HTTPS**: activate the toggle to use HTTPS instead of HTTP. Choose an existing key from the dropdown menu, or click **New** to upload a new key from your local drive.&#x20;
   * **Authentication protocols**: select **ALL** or the specific SSL/TLS protocols supported:
     * SSLv3
     * TLSv1
     * TLSv1.1
     * TLSv1.2
     * TLSv1.3

Use the **Partnerships** section to create the Partners and the Partnerships needed to configure the AS2 communication between the sending and receiving systems.

To **create the** **Partners**, go to the Partnership section and follow these steps:

1. Click **Edit**.
2. In the **Associate Partnerships** window, select the **Partners** tab.
3. Click **New** and fill in these fields to create the sending partner:
   * **Name (\*)**: sending partner's name
   * **Email (\*)**: sending partner's email
4. Click **Save** to confirm.
5. Repeat these steps to create the receiving partner.&#x20;

To **create the Partnership** between the previously created Partners, follow these steps:

1. In the same **Associate Partnerships** window, open the **Partnerships** tab.
2. Click **New**.
3. Fill in the following fields:
   * **Name (\*)**: assign a unique name to the partnership between the two partners.&#x20;
   * **From (\*)**: select the sending partner.
   * **Alias**: optionally select the **sender’s certificate** used to verify the digital signature of incoming AS2 messages.\
     The certificate must have been imported into **Settings** → **Security** → **Trust Store** → **Certificates** → [Importing certificates](https://docs.primeur.com/data-mover-smart/settings/security/trust-store#importing-certificates).
   * **To (\*)**: select the receiving partner.
   * **Alias**: optionally select the **receiver's private key** associated with the certificate shared with the sender. It will be used to decrypt the AS2 messages received.\
     This private key is in **Settings** → **Security** → [Key Store](https://docs.primeur.com/data-mover-smart/settings/security/key-store).
   * **Folder (\*)**: select the VFS folder where the received files will be saved. It must belong to the VFS selected earlier. \
     Note that the VFS folder is not linked to the AS2 path (meaning the endpoint http\://\<host>:/pathAS2). Instead, it is associated with the Partnership, which is then associated with the server.
   * **Signature**: select the signature algorithm used to verify incoming AS2 messages.
   * **Encryption**: select the encryption algorithm used to decrypt incoming AS2 messages.
   * **MDN required**: enable this option to request a Message Disposition Notification (MDN).\
     The MDN confirms to the sender that the file was received and processed. It is digitally signed by Data Mover Smart and handled in synchronous mode. Asynchronous MDN is not supported in this version of Data Mover Smart.

{% hint style="info" %}
**Note:** The Spazio **TRANSPORT\_DOMAIN** property is not available in Data Mover Smart. Certificates are managed using the **Alias** fields defined in the Partnership configuration.\
Note also that the Spazio **AS2 ID** corresponds to the **Partner Name** in Data Mover Smart.
{% endhint %}

4. Click **Save** to create the Partnership.
5. Click **Close** to exit the window.&#x20;
6. Click **Save** to finalize the server creation.&#x20;
