GnuPG decrypt canbt find key from webmethods

I’m using ftp to get a pgp-encrypted file from a partner. I have a webMethods flow that invokes pub.client:ftp and it gets the file. I then use pub.file:getFile to read the contents in, and pub.string:bytesToString to turn the “body” document into a string. I then use the pub.openpgp:decrypt service with that text as input, and it appears to try to run this command:

gpg --homedir e:\webMethods6\IntegrationServer\gnupg --no-tty --armor --yes --decrypt

with the string is the “input.” but it gives this error:

gpg: encrypted with RSA key, ID AF9C9841
gpg: decryption failed: secret key not available
gpg: encrypted with RSA key, ID AF9C9841
gpg: encrypted with RSA key, ID AF9C9841
gpg: decryption failed: secret key not available

however, if I run the command from command line with a file as input…

gpg --homedir e:\webMethods6\IntegrationServer\gnupg --no-tty --armor --yes --decrypt PGPFILE

where PGPFILE is the file, it decrypts fine. so why doesn’t gpg recognize the secret key when it’s invoked from webMethods openpgp package?

Hi Luke,

Are you able to solve this problem. Can you please let me know if you have solved this? I am also getting the same error.

Thank you in advance,
Priyatham Porika

I’m getting the same error and don’t have a clear reason why it’s happening. I can decrypt the file from the command line, but not in webMethods.

Hi,
Using OpenPGP package, I am able to encrypt file, but I am unable to decrypt file. it throws following error:
“gpg: Sorry, no terminal at all requested - can’t get input”

corresponding entry in my openpgp.properties file is:
pgp.decryptfile= --homedir {0} --no-tty --armor --verbose --yes --decrypt-files {1}

Appreciate, Let me know if i missed any parameter. I guess it has to do with Passphrase, but i am unable to find it in properties file.

Thanks,
Puneet Saxena

Puneet,
I think you are right about the passphrase file, try this:

–batch --homedir yourdirectoryhere --passphrase-file yourdirectoryhere\pgp.txt --armor --yes --decrypt-files file.pgp

Thanks Markg,

Infact I tried something else (but Passphrase related) to get it worked. I refered A_Sample_OpenPGP_Implementation_for_Integration_Server[1].pdf (downloaded from advantage) page -5.


removed the passphrase using gpg --edit -key command, I got decryption worked for me.

Thanks,
[FONT=Helvetica][SIZE=2]Puneet Saxena

[/size][/font]

Glad you got it working. If you have an existing corp key that has a passphrase associated with it you can read it in from a file (make sure you lock down access to the file):eek: and it will work with the IS as well.

My question is what happens if I have two keys configured in IS. I encrypted the file with the second public key, then decrypted the file generated. I was expecting the wM uses the second private key to decrypt the file. But I saw it gave me the info like:

gpg: encrypted with 1024-bit ELG-E key, ID 5B3C2930, created 2007-06-01
“key1 (webMethods Server Test Key) <xxx@hotmail.com>”

wM was using the first key to decrypt the file without the problem (decryptFile sevice).

Encrypt command line is as follows:(encryptFile service)

–homedir certs\pgp --no-tty --armor --yes --recipient key2 --encrypt-files h:\webMethods\PGP\newTest\testEncrpt.txt

what steps did I miss? is there a problem on these two keys setting?

here is the decrypt setting in OpenPGP
pgp.decryptfile= --homedir {0} --no-tty --armor --yes --decrypt-files {1}

Thanks,

Kathy

gpg decrypt error from wm developer

hi
i am trying to decrypt the file using gpg , here is the code that i am using from developer
gpg --passphrase “mypassphrase” -o “/opt/Delta/AE4_PAX/test/catering_20090520.csv” --decrypt “/opt/Delta/AE4_PAX/test/catering_20090520.csv.pgp”

when i run this on the command shell of linux, it works fine but when i run this from developer it gives me the following error

usage: gpg [options] [filename]

any help is appreciated.

Raj Pamishetty

try it without passphrase in wM. It might solve your issue.

Was this ever solved as I having the exact same problem.
I’m not using a pass phrase

Hey I am facing the same issue…Could you mplease let me know how you solved…I did not find the document which you have mentioned as well

–homedir C:\Users\aeadmin_vignesra\AppData\Roaming\gnupg --no-tty --armor --yes --passphrase=danzas2019 --pinentry-mode loopback --decrypt-files C:\PGP\81829.txt.asc

Please use this command line to avoid the passphrase prompt in windows environment.