Redirected I/O with GnuPG?

David Shaw dshaw at jabberwocky.com
Mon Jun 13 21:42:09 CEST 2005


On Mon, Jun 13, 2005 at 04:35:44AM -0500, Robert J. Hansen wrote:
> I'm hitting a stumbling block trying to write a small snippet of C# 
> which fetches information about cipher preferences.  Since I've not been 
> able to find information about the keyring file format,

http://www.ietf.org/rfc/rfc2440.txt

The keyrings are just key packets strung together.

> I'm falling back 
> to using GnuPG to do the keyring parsing.  This is a suboptimal 
> solution, but it'll do for reasonably small keyrings.
> 
> The problem is that for some reason I'm entirely unable to read in 
> anything from GnuPG's output.  I'm invoking GnuPG as:
> 
>    gpg --command-fd 0 --status-fd 2 --no-tty --edit-key <keyID>
> 
> While I'm able to receive status messages on standard error, any attempt 
> to read any amount of data from standard output will block indefinitely.

Try adding --with-colons to your command line.

David



More information about the Gnupg-devel mailing list