# ValidateAndParsePayload

Required Frends version: 5.7+

Required .NET version: 8.0

Compatible Agents: Unknown

Source code: <https://github.com/FrendsPlatform/Frends.As2/tree/main/Frends.As2.ValidateAndParsePayload>

{% tabs %}
{% tab title="Parameter: Input" %}

| Name                                   | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| -------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Headers : `Dictionary<String, String>` | <p>HTTP headers from the AS2 request containing AS2-From, AS2-To, Message-ID and other AS2 metadata.</p><p><br>Default: <code>-</code><br>Example: <code>{ "AS2-From": "TestSender", "AS2-To": "TestReceiver", "Message-ID": "</code><a href="mailto:12345@example.com"><code><12345@example.com></code></a><code>", "Subject": "Test AS2 Message", "MIME-Version": "1.0", "Content-Type": "application/pkcs7-mime; smime-type=enveloped-data; name="smime.p7m"" }</code></p> |
| Body : `Byte[]`                        | <p>Raw body content as byte array containing the AS2 message payload (encrypted/signed data).</p><p><br>Default: <code>-</code><br>Example: <code>Encoding.UTF8.GetBytes("This is a test AS2 message payload")</code></p>                                                                                                                                                                                                                                                     |
| {% endtab %}                           |                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |

{% tab title="Parameter: Connection" %}

| Name                                | Description                                                                                                                                |
| ----------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------ |
| RequireSigned : `Boolean`           | <p>Forces signature validation when enabled.</p><p><br>Default: <code>False</code><br>Example: <code>true</code></p>                       |
| PartnerCertificatePath : `String`   | <p>Path to partner's public certificate (.cer) file.</p><p><br>Default: <code>-</code><br>Example: <code>C:\Certs\partner.cer</code></p>   |
| RequireEncrypted : `Boolean`        | <p>Forces decryption when enabled.</p><p><br>Default: <code>False</code><br>Example: <code>true</code></p>                                 |
| OwnCertificatePath : `String`       | <p>Path to your own certificate file in .pfx format.</p><p><br>Default: <code>-</code><br>Example: <code>C:\Certs\mycompany.pfx</code></p> |
| 🗝OwnCertificatePassword : `String` | <p>Password for your private key certificate.</p><p><br>Default: <code>-</code><br>Example: <code>mySecurePassword123</code></p>           |
| {% endtab %}                        |                                                                                                                                            |

{% tab title="Parameter: Options" %}

| Name                             | Description                                                                                                                    |
| -------------------------------- | ------------------------------------------------------------------------------------------------------------------------------ |
| ThrowErrorOnFailure : `Boolean`  | <p>Whether to throw an error on failure.</p><p><br>Default: <code>True</code><br>Example: <code>false</code></p>               |
| ErrorMessageOnFailure : `String` | <p>Overrides the error message on failure.</p><p><br>Default: <code>-</code><br>Example: <code>Custom error message</code></p> |
| {% endtab %}                     |                                                                                                                                |

{% tab title="Result: Result" %}

| Name                   | Description                                                                                                                                                                      |
| ---------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Success : `Boolean`    | <p>Indicates if the task completed successfully.<br>Example: <code>true</code></p>                                                                                               |
| Error : `Error`        | <p>Error that occurred during task execution.<br>Example: <code>object { string Message, object { Exception Exception } AdditionalInfo }</code></p>                              |
| Payload : `String`     | <p>Decrypted/decompressed business data (EDI/XML/JSON).<br>Example: <code>Test message</code></p>                                                                                |
| As2From : `String`     | <p>AS2 sender identifier.<br>Example: <code>PartnerAS2</code></p>                                                                                                                |
| As2To : `String`       | <p>AS2 receiver identifier.<br>Example: <code>MyCompanyAS2</code></p>                                                                                                            |
| MessageId : `String`   | <p>ID of the received message.<br>Example: <code>"</code><a href="mailto:123456789@example.com"><code><123456789@example.com></code></a><code>"</code></p>                       |
| MdnReceipt : `MdnData` | <p>MDN receipt generated by the AS2Receiver. To be used later in CreateMdnResponse.<br>Example: <code>object { "Headers": "...", "Message": "...", "Content": "..." }</code></p> |
| {% endtab %}           |                                                                                                                                                                                  |

{% tab title="Changelog" %}

## Changelog

### \[1.0.0] - 2025-09-11

#### Changed

* Initial implementation
  {% endtab %}
  {% endtabs %}
