Signing Outgoing Messages in BizTalk Server using AS2 protocol

In this article I will show to send encrypted and signed message to destination trading partner in BizTalk Server.

I was working on some project earlier this month in which we have to send EDI documents using AS2 protocol. I will not go into the detail of setting up an AS2 protocol and targeting to the audience who are already familiar with BizTalk Server EDI messaging and protocols like AS2 and X12.

For each source and destination trading partners we have to create two parties one for source and one for destination and using those parties you can create agreements. When creating an agreement you have a choice whether to use X12, AS2 or EDIFACT protocol. Here I have used AS2 protocol. Each protocol have different set of attributes and methods to send messages.

Message can be signed using Certificates in BizTalk. You can create a test certificate using Visual Studio command line utility makecert. Certificate is a combination of private/public key pairs. For all outgoing messages BizTalk uses the private key to sign the messages and public key to encrypt the messages.

  • The private key .pfx file has to be imported in the Current User/Personal/Certificates folder.
  • The public key .cer file has to be imported in the Local Computer/Other People/Certificates folder.

Now you have to enable the encryption and sign options on the Validation tab of the Agreement window.



Make sure to restart the application instance. The message will be encrypted and signed using the private public key of the certificates.





Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s