I have a script (PHP running as CGI in this case)
I use it to call gpg with a text string that I have.
My command inside the PHP scripts that gets executed at the shell
$message = "some text comming in from space";
$fd = fopen('some/path', "w"); // make a file
fwrite($fd, $message); // write my variable string to it
fclose($fd); // close the file
// here I build the command to execute. So I pipe the temp file to gpg
$command = "cat " . $path . " | /usr/bin/gpg...snip... -e -
exec($command, $encrypted); // execute..
//(encrypted contains the result of command)
unlink($path); // and eventually delete the file
Don't worry about the php. The main point here is the line that starts
with $command. Notice that I am creating a file just to send it to
GPG. Is there a way to directly send the $message variable in a manner
that gpg will be happy. Maybe there is a way to create a 'virtual
file' or pehaps I thought that I could echo $message and somehow give
gpg the device name of the output device but I;m not sure how to do
anything like that.