I'm trying to write a console application that will decrypt a gpg signature on request. Everything's going fine, EXCEPT for the part where it prompts for my GPG password. How do I call
var startInfo = new ProcessStartInfo("gpg.exe");
startInfo.Arguments = "--decrypt"; //this is where I want to insert "--passphrase MyFakePassword"
startInfo.CreateNoWindow = true;
startInfo.UseShellExecute = false;
startInfo.RedirectStandardInput = true;
startInfo.RedirectStandardOutput = true;
startInfo.RedirectStandardError = true;
startInfo.WorkingDirectory = @"C:\Program Files (x86)\GNU\GnuPG";
var proc = Process.Start(startInfo);
var sCommandLine = stringData + "\n"+(char)26+"\n"; //stringData is the encrypted string
var result = proc.StandardOutput.ReadToEnd();
I did a bit more digging. A few months ago someone reported this as a bug on Gpg4Win's forums. The only solutions at this time are to roll back from 2.1.0 to a previous version (not an option in my case), disable the password for the key, or pipe it in from text. Here's the forum post: http://wald.intevation.org/forum/forum.php?thread_id=1116&forum_id=21&group_id=11 There is no comment from the development team.