This article provides procedures for configuring certificates for AS2 messages and includes the following sections:
The following table lists the certificate function, and if a public or private key is used.
For information about what certificate needs to be configured at which location, see Configuring Certificates for AS2 at http://msdn.microsoft.com/en-us/library/bb728096(BTS.10).aspx.
To sign outgoing AS2 messages in BizTalk Server, you need to configure the following:
This section covers the following:
Signing a message in the digital world is same as signing a paper in the non-digital world. You are the only person allowed to sign the message but other people can look at it and verify your signature. In order to sign an outgoing digital message, you use a certificate. The certificate is a pair of public and private keys. To sign a message, you will need a certificate that has the private key. Certificates are stored in certificate stores. Every user has a Personal certificate store. Certificates used for signing, should be stored in the Current User/Personal Certificate Store of the BizTalk Server process account that will be running the AS2Send pipeline (this is because AS2 Decoder in the send pipeline will be signing the message).
It is very important to understand that every account has its own personal user certificate store. If you logged in to the machine using the admin account, you open the MMC and load the certificate snap-in, and then configure the certificate. This certificate will not be accessible to the BizTalkService account. In order to configure the certificate that will be used for signing, you have to do the above operation using the BizTalkService account. Either log in to the machine using the BizTalkService account or run the MMC with the BizTalkService account.
If the certificate is configured properly, when you open the certificate MMC using the BizTalk service account, you should see the certificate under the Current User -> Personal certificate store. If not, then use the procedure to export and import the certificate in the right store. Make sure that this certificate has a private key. If you see that the certificate is configured correctly with the BizTalkService account, than you can skip all the steps below explaining how to install the Certificate Authority and how to issue a certificate.
To set up an enterprise root CA in Windows Server 2008:
To request a certificate from Windows 2008 Root CA
If you created and configured the certificate using the administrator or some other account besides the BizTalkService account, you will need to export the certificate from the logged in user store to a file. After that you will need to import the certificate into the BizTalkService account store. How to export the certificate to a file from a certificate store:
Right-click Party, and then click AS2 Properties. Go to the tab Party as AS2 Message Receiver. Check Sign Message.
The following steps are needed only if you want to request a signed MDN. In order to request a signed MDN, the receiving partner will need to sign the MDN using a private key and you will need the receiver Party’s public key configured to verify the signature on the incoming MDN. Right-click Party, and then click AS2 properties. Go to the tab Party as AS2 Message Receiver. Check Request MDN and Request signed MDN. Make sure that the signing algorithm is the same as what you see in the certificate. In the screenshot below, the signing algorithm for MDN is "SHA1". The partner should sign the MDN using a certificate with the SHA1 algorithm. You can validate the signing algorithm by looking at the Thumbprint algorithm in the certificate.
In this section, we will cover the following:
Signing a message in digital world is same as signing a paper. Only you can sign it but everyone else can look at it and verify your signature. In order to verify the signature of an incoming digital message, you use a certificate. The certificate is a pair of public and private keys. To verify the signature of a message, you will a partner certificate, however, you will need only the public key of the certificate to verify the signature in the incoming message.
Example: If a Partner, Fabrikam, signed a message using their private key and sent you the message, you will need to ask Partner, Fabrikam, to send you the public key of the certificate that they used to sign the message.
Certificates are stored in certificate stores. Every computer has a certificate store. Certificates (public key) used for signature verification are stored in the Local Computer/Other People Certificate Store. Incoming messages are received by the AS2 Receive pipeline. Hence the AS2 Decoder is responsible for verifying signature of incoming messages. For AS2, the incoming messages are received using HTTP adapter. The HTTP Receive port runs in Isolated Host. Isolated host runs in IIS application pool. Hence, the identity of the application pool (running the BTSHTTPReceive.dll) will be used to verify signature of incoming message.
The user profile of the account running the IIS Application pool needs to be loaded in memory. An account can access a certificate only if the user profile is loaded in memory. Some of the common things that loads a user profile of an account is logging into the machine, and then opening an MMC. Just a running IIS service will not load the user profile. In IIS7, there is a checkbox where you need to specify that the user profile needs to be loaded. In previous IIS versions, you will need to run some additional tool to load a user profile if you find that signature verification is failing because the user profile is unloaded. We have seen intermittent signature verification issues because the user profile gets unloaded after a period of inactivity for that account. The following steps related to user profile applies only to IIS7 (Windows 2008 and Windows 7).
If you are the sender of the message, you will need to export the public key of the signing certificate and send it to your partner.
Before doing the following procedure, make sure that you have imported your partners public key to the Local Computer/Other People’s Certificate Store. To validate signature of incoming document, the signature verification certificate is configured at the Party properties.
However, if you would like to enforce that the incoming message from that partner should be signed, regardless of the AS2 header settings, you can specify that in BizTalk Server Party settings.
This section first covers encryption concepts, followed by the procedures to encrypt outgoing AS2 messages.
Messages are encrypted so that no one can sniff the messages on the wire and misuse them. Messages are encrypted using public key. As mentioned before, certificates are combination of public and private keys. Everyone can encrypt the messages because public keys are public, however, only intended recipient will have access to the private key and will be able to decrypt the message.
To encrypt an outgoing message, you need to do the following configurations:
To encrypt outgoing messages, you will need to ask the partner to send you their public key for the certificate that they will be using to decrypt the incoming messages. This public key should be placed in the Local Computer/Other People Store. For step by step instructions, refer to How to import into Local Computer/Other People Store.
The AS2 Encoder in the AS2Send pipeline is responsible for encrypting outgoing messages.
This section first covers decryption concepts, followed by the procedures to decrypt incoming AS2 messages.
Messages are decrypted using private key. Everyone can encrypt the message using public key but only the intended recipient can decrypt it using a private key.
Decryption is done using your private key. This is configured in the Local Users/ Personal Store.
AS2 Messages are generally received using an HTTP adapter. In BizTalk Server, HTTP Receive host runs under BizTalksolated host, which is under IIS application pool identity running BTSHTTPReceive.dll. Therefore, when you configure the certificate (private key) for decryption, make sure that you are logged in the machine using the IIS app pool identity that is running BTSHTTPReceive.dll that will be receiving the encrypted messages.
If you do not have the certificate that you will be using to decrypt the incoming messages, you can use the same steps you used to generate the certificate by using the Windows CA and also install the certificate using the same steps as in the signing section.
How to install Certificate Authority in Windows Server 2008
How to request a certificate from Windows Server 2008 CA
How to issue certificate from Windows Server 2008 Root CA
Event Type: Error Event Source: BizTalk Server 2009 Event Category: (1) Event ID: 5804 Date: 3/23/2011 Time: 11:16:08 AM User: N/A Computer: FARI22232726
Unable to access Party using Party: AS2-From..
MSDN: Developing and Configuring BizTalk Server AS2 Solutions
Another important place to find a huge amount of BizTalk related articles is the TechNet Wiki itself. The best entry point is BizTalk Server Resources on the TechNet Wiki.
Steef-Jan Wiggers edited Revision 58. Comment: Added MSDN Resource link
Sandro Pereira edited Revision 57. Comment: Fixing text format
Sandro Pereira edited Revision 56. Comment: Fixing text format
Sandro Pereira edited Revis