Answered
GPG, CFEXECUTE and cfGnuPG
I'm building an application in CFMX 6.1 (on Windows 2000
Server) that needs to take a file or files encrypted with our GPG
public key and decrypt them to produce XML files. I'm using GnuPG,
and have worked out all the encrypt/decrypt stuff on the command
line of the server. I then was using the cfGnuPG CFC with the
gpg.jar Java wrapper to encrypt and decrypt data streams, which
worked great, but the gpgDecrypt function in that CFC doesn't seem
to handle full files, and if I read the file contents into a
variable and then try to decrypt it, it fails.
So what I'm now back to trying is to use CFEXECUTE to call the decryption function. This command works from the command prompt on the server:
> C:\Progra~1\GNU\GnuPG\gpg.exe --passphrase-fd 0 < c:\gnupg\pp.txt -o E:\devroot\iqvc\input\\neworders.xml -d e:\devroot\iqvc\input\\128391924.neworders
I put my passphrase in a text file and pass it into the passphrase-fd parameter as suggested, and the file designated is decrypted and saved as the new filename.
However, executing this command from CFEXECUTE just hangs--I see a new gpg.exe process spawn on the server, but no output is returned (see attached code). The outputfile is created, but remains empty, and the CF page times out after the 120 seconds. I can do a simple CFEXECUTE of gpg.exe with the "--list-keys" argument, and it returns the correct output. So what's different about this decrypt command? If the command were producing a response prompt, shouldn't that write to the outputfile?
I gather that the CFEXEXCUTE process runs GPG under the "Default User" profile, since when I used it to create keys, that's where they went. Is that correct?
If anybody has any ideas, or a better way to do this, please let me know.
So what I'm now back to trying is to use CFEXECUTE to call the decryption function. This command works from the command prompt on the server:
> C:\Progra~1\GNU\GnuPG\gpg.exe --passphrase-fd 0 < c:\gnupg\pp.txt -o E:\devroot\iqvc\input\\neworders.xml -d e:\devroot\iqvc\input\\128391924.neworders
I put my passphrase in a text file and pass it into the passphrase-fd parameter as suggested, and the file designated is decrypted and saved as the new filename.
However, executing this command from CFEXECUTE just hangs--I see a new gpg.exe process spawn on the server, but no output is returned (see attached code). The outputfile is created, but remains empty, and the CF page times out after the 120 seconds. I can do a simple CFEXECUTE of gpg.exe with the "--list-keys" argument, and it returns the correct output. So what's different about this decrypt command? If the command were producing a response prompt, shouldn't that write to the outputfile?
I gather that the CFEXEXCUTE process runs GPG under the "Default User" profile, since when I used it to create keys, that's where they went. Is that correct?
If anybody has any ideas, or a better way to do this, please let me know.
