AS2connector component serves as a connector to send/receive messages as per AS2 protocol.

Icon

AS2 (Applicability Statement 2) is a specification about how to transport data securely and reliably over the Internet. Security is achieved by using digital certificates and encryption.

AS2Connector can be configured in two modes as below:

  • Send: To send encrypted/signed message to receiver.
  • Receive: To decrypt and verify the signature of message received.

Configuration and Testing

The component can be configured using the Configuration Property Sheet as explained in the following sections.

Connection Configuration


Figure 1: Connection configuration details

Attributes

Send connection details from input

If this property is enabled, parameters to create the connection can be specified in the input message.

Connector Mode

Send

When Send mode is chosen, Send Configuration section appears as in Figure 1.

Send URI

URI where the HTTP server is present.

Maximum Idle Timeout (in ms)

The maximum time to close the idle connections. The default value is 300,000.

Receive

When Receive mode is chosen, Receive Configuration section appears as below.


Figure 2: Receive Configuration details

The descriptions for the Send Configuration parameters are provided in the below table:

AttributesDescription
HostThe host name or the IP address where the server will be started.
PortThe port number on which server will run.
Timeout (ms)

To specify the time till which this component will wait for acknowledgment. 

Default value is 0 which specifies infinite timeout.

New server instance can be created by clicking the  button in the Receiver Configuration section.

AttributesDescription

Display Name

The unique display name for the context. The names of the ports that are generated corresponding to a context are suffixed by __<Display Name>

Resource Base

Location of the resource that contains static content like images, css and so on. This can be any valid path in the file system (may also be relative to %FIORANO_HOME%\runtimedata\PeerServers\<profile-name>\FPS\run\components\AS2Connector\4.0) or a web URL. The resources present in resource base will then be hosted in URLs of the form http://<hostname>:<port>/<contextpath>/<resource>

Path

The unique context path of the AS2 request corresponding to a context. The path of the context will be computed relative to the server details provided by properties Host Name and Port. 

The URI of a context will be http://<Host Name>:<Port>/<Path>.

Cache Control

The cache control mechanism that is to be used to cache the static content. For example, cache control value "max-age=3600,public" states that static content would be cached for up to an hour and shared between all users, without checking the server.

For valid Cache-Control values, please refer to http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9

AS2 Configuration

The next panel has four sections as follows:

  1. Encryp/Decrypt Configuration
  2. Signature Configuration
  3. MDN configuration
  4. AS2 Headers

The attributes available in each section and their description are mentioned in the below sections.

Encryp/Decrypt Configuration


Figure 4: Encryption configuration details

Enable Encryption/Decryption

When this option is selected, message will be encrypted in case of Send connect mode and decrypted in case of Receive connect mode with the provided algorithm and Keystore details.

Algorithm

Algorithm to be used while encrypting/decrypting. The types of algorithm that are available in the drop-box are:

  • AES128
  • AES192
  • AES256
    AES is a block cipher, 128, 192 and 256 being the variable key length in bits. 
  • DESEDE3
     DES, the Data Encryption Standard, is triple-DES encryption where an encrypt operation is encrypt-decrypt-encrypt, and decrypt is decrypt-encrypt-decrypt.  
  • RC2
    RC2 is a block cipher with a 64-bits block cipher with a variable key size that range from 8 to128 bits. 
KeyStore SettingsDescription
KeyStore TypeFor Java keystore file format, this property has the value jks(or JKS). You do not normally specify this property, because its default value is already jks.
KeyStore PathPassword to access the private key from the keystore file.
Alias If the operation is SEND, Host private key alias should be configured.If the operation is RECEIVE, Partner public key certificate alias should be configured.
KeyStore PasswordPassword to unlock the keystore file (store password).
Key PasswordSpecifies the password for the key pair.

Refer to Keystore Configuration Section below for configuring keystore and certificate alias details.

Signature Configuration

Enable Signing

Enable this to sign or verify signature of a message.


Figure 5: Signature configuration details

Algorithm

Algorithm to be used while signing. The types of algorithm that are available in the drop-box are:

  • SHA1withRSA
  • MD5withRSA

Refer Enable Encryption/Decryption section for the description about KeyStore.

MDN Configuration

MDN provides a notification of disposition of a message, that is, whether it was decrypted and read by recipient, discarded before being read etc.


Figure 6: MDN configuration details

Working of a MDN is as mentioned below:

  • Upon the receipt of the message and its successful decryption or signature validation (as necessary) a "success" MDN will be sent back to the original sender. This MDN is typically signed but never encrypted (unless temporarily encrypted in transit via HTTPS).
  • Upon the receipt and successful verification of the signature on the MDN, the original sender will "know" that the recipient got their message (this provides the "Non-repudiation" element of AS2)
  • If there are any problems receiving or interpreting the original AS2 message, a "failed" MDN may be sent back. However, part of the AS2 protocol states that the client must treat a lack of an MDN as a failure as well, so some AS2 receivers will simply not return an MDN in this case.
  • MDN messages can be returned asynchronously and synchronously. As per default settings, MDNs are sent synchronously.
  • Synchronous MDN allows AS2 MDNs to be returned to AS2 message sender clients over the same HTTP connection they used to send the original message. This "MDN while you wait" capability makes "AS2 Sync" transfers the fastest of any type of AS file transfer, but it also keeps this flavor of MDN requests from being used with large files(which may time-out in low-bandwidth situations)
  • Asynchronous MDN allows AS2 MDNs to be returned to the AS2 message sender's server later over a different HTTP connection. This flavor of MDN request is usually used if large files are involved or if your trading partner's AS2 server has poor Internet service

In Asynchronous MDN, sender specifies to which URL it wants to get MDN from receiver,so this property is enabled only in SEND mode.

Signed

Select this for signing MDN, which will set the disposition-notification-options AS2 Header for default value. signed-receipt-protocol=required,pkcs7-signature; signed-receipt-micalg=required,sha1,md5.

Async URL

URL where the MDN should be sent to for Asynchronous MDN. The provided URL will be set as Receipt-Delivery-Option AS2 header.

User Agent

User which processes the AS2 request.

Enable Compression

Enables compression of signature.

AS2 Headers


Figure 7: AS2 Headers details

Some of the AS2 headers are added by default. User can add/remove headers as necessary.

  • as2-from: Sender of AS2 message.
  • as2-to: Receiver to whom the AS2 message is sent to.
  • subject: Specifies the subject of the message.
  • Disposition-notification-to: If this header present, it serves as a request for MDN to be returned. If it is accompanied by receipt-delivery-option header, then it is a request for an asynchronous MDN.If not, it is a request for Synchronous MDN. If this header property is absent, then MDN is not required.
  • disposition-notification-options: MDN options that deals with signing like signed-receipt-protocol and signed-receipt-micalg.When signed-receipt-protocol is set to "pcks7-signature",is used to request a signed receipt from receiving party and indicates the format in which the signed receipt should be returned to requestor.Similarly, micalg specifies sender's desired algorithms with which receiver should sign MDN by.
  • message-id: Identifier of message.

Keystore Configuration

Refer to the SSL Configuration – Client perspective section to generate a Client Keystore, get the Digital Certificate of Partner and create the Client Truststore.

Host Alias

In the above reference section, "client1" is the host alias which must be provided while configuring AS2Connector as below:

  1. Send operation - value for Alias textbox in Signature Configuration panel.
  2. Receive operation - value for Alias textbox in Encrypt/Decrypt Configuration panel.
Partner Alias

In the above reference section, "mailserver" is partner's alias  which must be provided while configuring AS2Connector as below:

  1. Send operation - value for Alias textbox in Encrypt/Decrypt Configuration panel.
  2. Receive operation - value for Alias textbox in Signature Configuration panel.

Input and Output

Input

The input schema is auto-generated for SEND mode based on whether Send connection details from input option is selected or not.

When it is selected, the input schema generated and the sample input XML are shown in figure 8 and figure 9.


Figure 8: Input Schema when Send connection details from the input option is selected


Figure 9: Sample Input XML when Send connection details from the input option is selected

When it is not selected, the input schema generated and the sample input XML are shown in the figures below.


Figure 10: Input Schema when Send connection details from input option is not selected


Figure 11: Sample Input XML when Send connection details from the input option is not selected

For all other cases, no schema is set on input/output ports.

Functional Demonstration

Scenario 1

Encrypting AS2 Message and receiving MDN over different HTTP Connection (async MDN).


Figure 12: Sample Event Process demonstrating Scenario 2

Configure one AS2Connector in Send mode, provide encryption details and async URL. Configure another in Receive mode with decryption details.

Configure HTTPReceive to start on URL provided in async URL.

Sender Configuration


Figure 13: Encryption and MDN Configuration in SEND mode.

Receiver Configuration


Figure 14: Decryption Configuration in RECEIVE mode

Input

Provide the same input as shown in Figure 11.

Output


Figure 15: Output Received on AS2Receiver(Display)

MDN Received at the output port of HTTPReceive :


Figure 16: MDN Received on Asyn_MDN(Display)

Adaptavist ThemeBuilder EngineAtlassian Confluence