SAP Knowledge Base Article - Preview

2567055 - "key invalid in message" error during message decryption in AS2 sender channel

Symptom

Your partner is sending encrypted messages to your AS2 sender channel. You have changed the security provider of the AS2 application from the IAIK library to BouncyCastle (BC). In the Message monitor you can see that the messages fail in the AS2 sender channel during the decryption:

Catching org.bouncycastle.cms.CMSException: key invalid in message.

In the default trace you can see a similar entry:

Catching org.bouncycastle.cms.CMSException: key invalid in message.
at org.bouncycastle.cms.CMSEnvelopedHelper.execute(CMSEnvelopedHelper.java:715)
at org.bouncycastle.cms.CMSEnvelopedHelper$CMSEnvelopedSecureReadable.getReadable(CMSEnvelopedHelper.java:631)
at org.bouncycastle.cms.RecipientInformation.getContentFromSessionKey(RecipientInformation.java:150)
at org.bouncycastle.cms.KeyTransRecipientInformation.getContentStream(KeyTransRecipientInformation.java:164)
at org.bouncycastle.cms.RecipientInformation.getContent(RecipientInformation.java:183)
at com.sap.aii.adapter.as2.ra.api.util.BouncyCastleUtils.decryptAndDecompressAS2Message(BouncyCastleUtils.java:663)
at com.sap.aii.adapter.as2.ra.api.AS2Receiver.parseMessage(AS2Receiver.java:425)
at com.sap.aii.adapter.as2.ra.integration.ChannelDispatcher.receive(ChannelDispatcher.java:404)
at com.sap.aii.adapter.as2.servlet.AS2DispatcherServlet.doPost(AS2DispatcherServlet.java:254)


Read more...

Environment

  • SAP enhancement package 1 for SAP NetWeaver Process Integration 7.1 >= SP08
  • SAP NetWeaver 7.3 >= SP05
  • SAP enhancement package 1 for SAP NetWeaver 7.3
  • SAP NetWeaver 7.4
  • SAP NetWeaver 7.5
  • SAP Process Integration, business-to-business add-on

Product

SAP NetWeaver 7.3 ; SAP NetWeaver 7.4 ; SAP NetWeaver 7.5 ; SAP NetWeaver Process Integration, business-to-business add-on 1.0 ; SAP enhancement package 1 for SAP NetWeaver 7.3 ; SAP enhancement package 1 for SAP NetWeaver Process Integration 7.1

Keywords

AS2, AS2 Sender, decryption, CMSException, decryptAndDecompressAS2Message, BC, BouncyCastle, BouncyCastleUtils, security provider, IAIK , Process Integration 7.11, PI 7.11, Process Integration 7.30, PI 7.30, Process Integration 7.31, PI 7.31, Process Orchestration 7.4, PI 7.4, PO 7.4, Process Orchestration 7.5, PI 7.5, PO 7.5, XI, AEX , KBA , BC-XI-CON-B2B-AS2 , Applicability Statement Protocol Adapter , Problem

About this page

This is a preview of a SAP Knowledge Base Article. Click more to access the full version on SAP ONE Support launchpad (Login required).

Search for additional results

Visit SAP Support Portal's SAP Notes and KBA Search.