cancel
Showing results for 
Search instead for 
Did you mean: 

PGP Decryption Error: File is no valid PGP Message, could not apply decryption.

10-14-2016 9:46 AM
arkesh_sharma Product and Topic Expert
8663 views 17 comments Go to solution
0 Likes
SAP Managed Tags
Subscribe

Hi Experts,

I have received both public and private keys from business and they are of type RSA-4096 with .ASC extension. The keys are generated by the business using a tool called GPG Keychain on a Mac machine. The keys are deployed on the server in the standard path - /usr/sap/<System ID>/<Instance ID>/sec

When I use them to encrypt the file, the encryption works fine but when I use the keys to decrypt the files, it fails in PI with the error:

com.sap.aii.af.lib.mp.module.ModuleException: File is no valid PGP Message, could not apply decryption.

The decryption is working fine in the tool but it is not working fine in SAP PI. Even a simple encrypted txt file (of extension .pgp) is failing with the above error. The configuration of the module is shown below in the snapshot:

Regards,

Arkesh

0 Likes

Accepted Solutions (1)

Accepted Solutions (1)

arkesh_sharma
Product and Topic Expert
Product and Topic Expert
0 Likes

Thank you all for your help and support.

The issue was really strange and the root-cause was not properly identified.

The work-around that we did was:

1. New RSA-2098 key-pairs were generated (using GPG4Win tool) on SAP PI server itself by the Basis Team

2. Public key was shared with the business partner(i.e. Sender System) while the private key was kept on the SAP PI server in the standard path (/usr/sap/<System ID>/<Instance ID>/sec)

3. Only two parameters on the module tab were specified for Decryption: ownPrivateKey and pwdOwnPrivateKey

4. The channel was activated with the above details and the decryption worked fine

Regards,

Arkesh

Answers (5)

Answers (5)

Former Member

Hello Arkesh,

Is the File encrypted + signed?

If yes you need to add the below in the module

partnerPublicKey

arkesh_sharma
Product and Topic Expert
Product and Topic Expert
0 Likes

Hi Raghuraman,

I checked with the person who created the encrypted file, he said it is not signed and only encrypted.

So I did not use partnerPublicKey parameter.

Former Member
0 Likes

Hello Arkesh,

Then this error could be due to wrong encryption of file and or any special characters/texts added in file by mistake.

Can you retest with new file or check if any issue is there in the file.

arkesh_sharma
Product and Topic Expert
Product and Topic Expert
0 Likes

Hi Raghuraman,

Is there a tool that you can suggest to find out the special characters in the encrypted file ?

Regards,

Arkesh

Former Member
0 Likes

Hello Arkesh,

You can decrypt using IGOLDER ,Manoj also suggested the same.

It could be due to wrong key or file issues(additional characters are something).

jonprow
Participant
0 Likes

Were you able to resolve? I believe it is required to have your partner sign and you would need their pub key referenced in sender module configuration.

https://help.sap.com/saphelp_nw-secure-connect103/helpdata/en/c6/62dcc1394d4a798fc4abdb406fa269/fram...

Thanks

Jon

bhavesh_kantilal
Active Contributor
0 Likes

Hello Arkesh,

Would suggest you follow the steps in OSS Note:2233818 - PI Messages Fail with 'Exception decrypting key' Error

Check if unlimited JCE is installed as if unlimited JCE is installed, then Key size 4096 should be supported.

Regards,

Bhavesh

Former Member
0 Likes

Hi Arkesh,

Usually while decryption it will automatically detects the algorithm.If RSA case is not working try with other algorithms like AES_128 or AES_256.

Thanks,

Anil Sumanth

apu_das2
Active Contributor
0 Likes

I think yo need not to mention the Root path if you are using the default /sec path. Please remove root path entry and try once.

Thanks,

Apu

arkesh_sharma
Product and Topic Expert
Product and Topic Expert
0 Likes

Hi Apu,

I have removed the root path as it is the default path where keys are stored. I am still getting the same error.

Regards,

Arkesh