one4k4 has asked for the wisdom of the Perl Monks concerning the following question:

This is a somewhat odd question. As the practice is generally not of the highest quality.

I'm running a copy of gnuPG as my encryption engine. Runs great. I love it. I've come to the point where I need it set up on other machines, run via open ("| gnupg..... commands sent to winNT via a nifty perl script.

If I import all the keys necessary, and set them to fully trusted, gnuPG does not prompt to STDIN. If a key is not fully trusted, gnuPG peacefully complains and says "do you want to use this key, type yes". So you have to manually type "yes" on the command line.

I've tried opening via pipe for read, opening via pipe for print, all to no avail. A search (notice I didn't say quick ;)) around the monastery revealed some insight, but not a solution.

I'm just scared that the script will run, the user maintaing the pc will have forgotten to trust the key, and therefore the script will run forever..

The gnupg options of --batch and --yes do not answer key-trust questions. For reasons that seem somewhat obvious to me..

open(PROG,"| $gpg -ea -o cryptthis.txt.asc -r someguy cryptthis.txt") +or die "$!"; print PROG "yes\n"; close(PROG);


Any thoughts? Links? Am I missing something completly obvious?

_14k4 - perlmonks@poorheart.com (www.poorheart.com)

Replies are listed 'Best First'.
Re: open pipe for print and gnuPG don't get along?
by one4k4 (Hermit) on May 24, 2002 at 14:11 UTC
Re: open pipe for print and gnuPG don't get along?
by one4k4 (Hermit) on May 24, 2002 at 14:42 UTC