Invoking gpg2.exe from C# script

Marc Haber mhaber at vp44.com
Tue Jul 12 16:48:08 CEST 2011


Hi guys.
I'm currently working on a small C# utility that, among other things, has
to decrypt files using GnuPG.
I would like the user to avoid typing the password each time, but I'm not
sure of how to call gpg2.exe while providing the passphrase on the command
line.
I tested this but it doesn't seem to work:

string sCommandLine = "echo \"" + passphrase + "\" | gpg2.exe
--passphrase-fd 0 -o \"" + outputFileNameFullPath + "\" --decrypt \"" +
inputFileNameFullPath + "\"";

Any tips?

MH




More information about the Gnupg-users mailing list