signing files from php script

Timo Schulz twoaday@freakmail.de
Mon, 22 Jan 2001 14:43:03 +0100


On Mon, Jan 22, 2001 at 02:12:18PM +0100, Juan Antonio Martinez wrote:


> > $pipe = "/usr/bin/gpg -o output_file --homedir path/to/gnupg";
> > $fd=popen($pipe,"w");
> > fwrite($fd,$msg);
> > fclose($fd);
>
> It doesn't work... my problem is that gpg allways ask me for a
> passphrase and cannot find any valid way to provide it from a apache/php3
> script. perhaps via a "dummy program..." but seems to me not a very good way
> to do the right thing...
What about this? $pipe = "/usr/bin/gpg --passphrase-fd=0"; $fd = popen( $pipe, "w" ); fwrite( $fd, $passphrase ); fwrite( $fd, $msg ); fclose( $fd ); Then gpg asks for the passphrase on the stdin. First we wrote the passphrase to the pipe and then the message, that should work (hopefully ;-)). Timo -- Two-a-Day at BuLUG.de keyid BF3DF9B4 www.FreeNET.de/joesixpack -- Archive is at http://lists.gnupg.org - Unsubscribe by sending mail with a subject of "unsubscribe" to gnupg-users-request@gnupg.org