CrushMFT Documentation

AS4#

AS4 is the newer way for companies and public bodies to exchange documents over the internet. Like AS2, a message is signed, so the receiver knows who sent it; encrypted, so only the receiver can read it; and answered with a signed receipt, so the sender can prove it arrived unchanged. AS4 is built on web services (SOAP, ebMS 3.0) and is the transport of the European Commission's eDelivery, of energy networks such as ENTSOG, and of other networks that ask for it.

The server does both sides: it receives AS4 messages from your partners and delivers the files into a user's folders, and it sends files to partners from a job. It also holds files for a partner that collects them itself (pull), and collects files that a partner holds for it.

AS4 is an add-on: it is in Business with the AS4 add-on, and in Enterprise. Without it, the AS4 path answers 503 with the reason, and the As4 task ends with the same reason.

The parts of an AS4 exchange#

Part Is
party ids each side has an identifier, agreed between you, such as acme-gw and exampleco-ap. They travel in every message.
the station your side: your party id, the key you sign with and the key messages to you are encrypted for
a partner agreement their side: their party id, their certificates, their address, the service and action you exchange, and where what they send is delivered. In AS4 this is called a P-Mode.
the message the files as attachments, signed and encrypted, posted to the partner's address over HTTPS
the receipt the partner's signed answer, which repeats the checksums of what you signed
the MPC for pull: the named queue (message partition channel) a message waits in until its partner asks for it

The profiles#

The station's signing key decides how messages are secured. There is nothing else to choose.

Signing key Profile Encryption
RSA eDelivery AS4 1.x the content key for the partner's RSA certificate (RSA-OAEP), AES-128-GCM
Ed25519 eDelivery AS4 2.0, EdDSA key agreement with the partner's X25519 certificate, AES-128-GCM
EC (P-256) eDelivery AS4 2.0, the ECDSA alternative key agreement with the partner's P-256 certificate, AES-128-GCM

An Ed25519 key can sign but not decrypt, so a 2.0 station has two keys: the signing key and a decryption key (X25519, or P-256 for ECDSA). Their certificates go to your partners: the signing certificate so they can check your messages and receipts, the decryption certificate so they can encrypt for you. Key stores are made with the Java keytool; an X25519 certificate is issued by the Ed25519 key (keytool -genkeypair -keyalg X25519 -signer ...).

AS4 is not available in FIPS mode.

Setting it up#

  1. Turn it on. Preferences › AS4 › Server: AS4 on, and the path partners post to (/as4/ by default). Save.
  2. Open a port. Preferences › IP / Servers: on the HTTPS listener partners reach, tick Take AS4 messages. Everything else on the port goes on as before. AS4 over plain HTTP is for tests.
  3. The station. Preferences › AS4 › Station: your party id, the host your message ids end in, and the key stores on the server with the key names (aliases) and passwords. A password you leave empty keeps the stored one. A station whose key cannot be loaded is not saved.
  4. A partner. Preferences › AS4 › Partners › Add a partner: an id for the agreement (jobs name it), their party id, their address, the service and action you agreed, their signing certificates and their encryption certificate (PEM), and the user and folder their files are delivered into. The list shows what is wrong with an agreement, and warnings such as a plain HTTP address.
  5. Test it. The play button of a partner sends an ebMS test message: the partner answers it with a receipt and delivers nothing. The answer shows whether the receipt came.

Receiving#

A partner posts a message to the path on a port that takes AS4. The server:

  • checks the signature against the partner's certificates, and only those (a message from a party with no agreement, or signed by another key, is refused);
  • decrypts and decompresses the files into a quarantine folder, under size limits;
  • scans the files for malware when Malware Scanning is on (a refused file refuses the message, with the reason);
  • answers with a signed receipt;
  • then uploads the files into the agreement's delivery user, into its folder ({partner}, {yyyy}, {MM}, {dd}, {HH} and {filename} are filled in), with that user's permissions, quotas and upload events. A name in use gets _1, _2 ...

A message that arrives again (the partner did not get the first receipt) gets the first receipt again and is not delivered twice, for as many days as Duplicates detected for says.

A file that cannot be delivered (the user has no space, no permission) is logged and counted; the receipt has already gone out.

Sending, queueing and pulling#

The As4 task of a job does all three, through a partner agreement:

Mode What happens
Send the files go to the partner now; the task waits for the receipt and resends until it comes
Queue the files are packaged now and wait until the partner asks for them (the agreement must allow They may pull); its receipt arrives when it does
Pull the task asks the partner for what it holds for you, until there is nothing more; each file is delivered as a received one and goes on to the next task

A schedule for pulling is the job's schedule. Preferences › AS4 › Messages lists the messages queued for partners: waiting, sent with a receipt, and failed. A queued message that is not answered goes out again after a minute, and after six tries it is filed as failed.

What was sent and received#

Every message is a line in the activity store, beside AS2's: received, sent and failed, with the partner, the message id and the receipt's id, so the AS2 reports by partner and failure show AS4 too. Metrics have crushmft_as4_* counters: received, refused (by error code), delivered, sent, queued, pulled. The log tag is AS4.

When it does not work#

The partner or the log says Usually
EBMS:0010 ProcessingModeMismatch no agreement fits: the party ids, or the service and action, differ from what the message carries
EBMS:0101 FailedAuthentication the signature does not match the certificates the agreement holds, or a pull request from a party that may not pull
EBMS:0102 FailedDecryption the message was encrypted for another key than the station's decryption key
EBMS:0103 PolicyNoncompliance the message is not signed, or not encrypted, though the agreement asks for it
EBMS:0006 EmptyMessagePartitionChannel a pull found nothing waiting; not an error
EBMS:0301 MissingReceipt no receipt after every resend
503 and "license does not include AS4" the add-on is not in the license

Not in this version#

Networks with rules of their own, such as Peppol (with its address lookup and certificates), ENTSOG, ICS2 and BDEW, are added when a customer needs one. AS4 in FIPS mode and an AS4 port on a DMZ server are not available yet; behind a DMZ, forward a port to an internal port that takes AS4.