gpg Wrapper/ ?stream? Problems?

Michal Goralczyk mogor@o2.pl
Wed Nov 27 14:18:02 2002


>Process that I'm running gpg has its input, output,
>and error streams redirected so that I can read and
?write directly from them, but for some reason the
>message that asks for the password comes up on the
>screen, and I have to manually type the password.

You must create another pipe just for password. And pass handle to pipe
using:
--passphrase-fd.

So, you should:
1) create pipe for password
2) write pass to pipe
3) close write pipe
4) call gpg with --passphrase-fd (and other args)

Note that probably when you call gpg, a command prompt window will appear
for a moment. If you don't like that you must specify something similar to
CREATE_NO_WINDOW flag for WIN32 API function CreateProcess().

P.S.
When I was doing the same thing as you I created warper DLL in C/C++ and
than use it in C#. I think C/C++ is more flexible for that.

regards
Michal Goralczyk