AS2 Message Encoder, Decoder & MDN Generator
Package, sign, encrypt, and inspect AS2 messages (RFC 4130) and generate or verify MDN receipts and MIC hashes.
Client-Side Execution & Privacy Guarantee
This utility executes 100% locally in your web browser. Your inputs, tokens, queries, and data payloads are never transmitted to any external server or backend.
AS2 (Applicability Statement 2) packages EDI or other business data inside an HTTP message that can be signed and encrypted with S/MIME. The AS2 Message Encoder, Decoder & MDN Generator lets you build, unpack, and verify these messages without installing a full AS2 server.
You can generate a Message Disposition Notification (MDN) that contains the correct Received-content-MIC, or verify an incoming MDN against the original payload. All cryptographic operations run locally.
AS2 Message Structure (RFC 4130)
An AS2 message is an HTTP POST whose body is a MIME entity. Required headers include AS2-From, AS2-To, Message-ID, and Disposition-Notification-To when a receipt is requested. The body may be plain, signed (multipart/signed), encrypted (application/pkcs7-mime), or both.
The tool constructs these headers and the corresponding MIME structure, or parses an existing message so you can examine each part, the signature, and the inner EDI payload. Disposition-Notification-Options can request a specific MIC algorithm.
MIC Calculation and MDN Receipts
The Message Integrity Check (MIC) is a base64-encoded digest of the content that was signed or, for unsigned messages, of the decrypted payload. RFC 4130 requires the MIC to be computed over the canonicalized MIME entity for signed messages.
When you request an MDN the generator produces a multipart/report or multipart/signed receipt that contains the Disposition header and the Received-content-MIC field using the algorithm negotiated in Disposition-Notification-Options (commonly sha-256). The original Message-ID is echoed exactly.
Local Cryptographic Operations
Signing and encryption use the Web Crypto API and the certificates you supply. Private keys never leave the browser. You can verify a signature, decrypt a message, or simply inspect the headers and MIME tree of an already-processed AS2 payload.
Because everything stays client-side, the tool is suitable for examining production messages that contain sensitive trading-partner data without risk of external exposure.
When to use this tool
- Build a minimal signed AS2 message to test a partner’s AS2 endpoint.
- Decode an incoming AS2 message and extract the EDI payload without a full gateway.
- Generate a synchronous MDN with a matching MIC to confirm receipt processing.
- Verify that an MDN’s Received-content-MIC matches the original message.
- Inspect AS2 headers and MIME structure when a partner reports a disposition error.
How to use the AS2 Message Encoder, Decoder & MDN Generator
- Paste an existing AS2 message (headers + body) or start with a raw EDI payload.
- Supply AS2-From, AS2-To, and Message-ID values.
- Optionally upload or paste a certificate for signing or encryption.
- Choose whether to sign, encrypt, or both, and select the MIC algorithm.
- Click Encode or Decode. The resulting MIME message or extracted payload appears.
- To create an MDN, supply the original Message-ID and the computed MIC.
- Copy the finished AS2 message or MDN for transmission or further analysis.
Worked examples
Unsigned MDN with MIC
Original Message-ID: <msg-001@example.com>, MIC algorithm: sha-256, Disposition: processed
Content-Type: multipart/report; report-type=disposition-notification; boundary=mdn-boundary\n\n--mdn-boundary\nContent-Type: text/plain\n\nMDN for message <msg-001@example.com>\n\n--mdn-boundary\nContent-Type: message/disposition-notification\n\nReporting-UA: CodePackr AS2 Tools\nOriginal-Message-ID: <msg-001@example.com>\nDisposition: automatic-action/MDN-sent-automatically; processed\nReceived-content-MIC: <base64-digest>, sha-256\n\n--mdn-boundary--
The Received-content-MIC field contains the base64 digest and the algorithm identifier exactly as required by RFC 4130.
Minimal AS2 headers
AS2-From: ACME, AS2-To: RETAIL, Message-ID: <msg-001@example.com>, Payload: ISA*00*...~
POST /as2 HTTP/1.1\nAS2-From: ACME\nAS2-To: RETAIL\nMessage-ID: <msg-001@example.com>\nDisposition-Notification-To: http://example.com/mdn\nContent-Type: application/edi-x12\n\nISA*00*...~
Required AS2 identification headers are present; the body is the raw EDI content.
Common mistakes and tips
- Always use the same MIC algorithm that was declared in the original message’s Disposition-Notification-Options.
- Canonicalize MIME headers before computing the MIC for signed messages; the tool performs this step automatically.
- Synchronous MDNs are returned in the HTTP response; asynchronous MDNs are sent to the URL or mailto address in Disposition-Notification-To.
- Keep the original Message-ID; the MDN must reference it exactly.
- Certificates used for signing should be trusted by the receiving partner; the tool does not perform trust-store validation.
Frequently asked questions
What is a MIC?
The Message Integrity Check is a cryptographic hash (commonly SHA-256) of the received content, base64-encoded and returned in the MDN so the sender can prove the partner received the exact bytes that were sent.
Does the tool implement the full AS2 protocol including HTTP transport?
It builds and inspects the AS2 MIME messages and MDNs defined by RFC 4130. Actual HTTP transmission is left to your own client or gateway.
Can I verify a signed MDN?
Yes. Supply the MDN and the sender’s certificate; the tool checks the signature and confirms that the Received-content-MIC matches the original payload.
Are private keys uploaded?
No. All signing and decryption operations use the Web Crypto API inside your browser. Keys remain on your machine.
Which MIC algorithms are supported?
SHA-256, SHA-384, and SHA-512 are supported, matching current recommendations. Legacy SHA-1 is available for older partners.