cancel
Showing results for 
Search instead for 
Did you mean: 

Invalid PKCS#1 padding: encrypted message and modulus lengths do not match!

0 Kudos
1,088

Hello Everyone,

We are trying to setup AS2 connection in receiver side to a third party for the first time in our PO landscape. We are signing with our public key and encrypting with 3rd party's public key with 3DES algorithm. MDN is in synch mode, and we have requested signing back. The flow is proxy to CSV via AS2 receiver.

  • When we send a test message, we get the below error in message log.

Transmitting the message to endpoint <local> using connection AFW failed, due to: com.sap.engine.interfaces.messaging.api.exception.MessagingException: javax.resource.ResourceException: javax.resource.ResourceException: MDN Disposition-modifier-extension is error: decryption-failed

  • We could see the below error in B2B log

The receiving system was unable to decrypt the message:
Unable to decrypt content; Caused by: Invalid PKCS#1 padding: encrypted message and modulus lengths do not match!.

  • The third part system is unable to decrypt the message and says there is a problem in encrypting. Their log also shows there is no signing or encrypting done when PO logs shows otherwise.
  • AS2 version used AS2 1.1 - Please confirm if there will be any discrepancy because of this version?
  • Content type for CSV file in AS2 receiver channel is configured as application/csv. is this correct or should it be changed to text/plain.
  • We have added the third party certificate in the trusted CA's. should this be done in a separate key store view?

Thanks in advance !!

Regards

Saikumar

Accepted Solutions (1)

Accepted Solutions (1)

PavanKumar
Active Contributor
0 Kudos

Hello Saikumar,

1) In the configuration perspective you need to sign with you own private key, partner will validate the sign with your public key and

2)as partner unable to decrypt the message just make sure to check with them that they are trying to decrypt the content with their own private key also cross verify the certificate you are using for encryption with them.

Regards

Pavan Kumar D

0 Kudos

thanks Pavan,

there was an issue with the public key which we have shared with Third-party team.

By sharing the correct public key the issue has been resolved

Answers (0)