Integrating GPG

Oliver White oliver.white@blibbleblobble.co.uk
Mon Feb 3 00:20:02 2003


Hiya. Could I bother the group with a simple question?

I'm trying to integrate GPG into a program, and it would be nice to call GPG 
using shell commands rather than have to statically-link any libraries.  
Enigmail is an example of this: you have to specify the GPG executable in the 
options, and it uses this to encrypt a temporary file.

The nearest I can find in documentation is --passphrase-fd [filenum], but the 
documentation doesn't help much with how to use it.  

------- trying -------
filenum = open(decoy_file, for_writing)
shell "gpg --passphrase-fd [filenum] ..."
print filenum, passphrase

or

filenum = open(file_containing_passphrase, for_reading)
shell "gpg --passphrase-fd [filenum] ..."
------- /trying -------

I don't really want to put any passphrases into a file, but I'd like to find 
some way of using GPG with a supplied passphrase, rather than having the user 
type it each time (which may not even be possible in a GUI)

Is there some feature I missed, or is there a good reason why I shouldn't even 
be trying?

Thanks

OJW