Mailing List Archive

having a library pass GnuPG options
I'm the developer of a Perl module to interact with GnuPG, and I've had a
hard time deciding how certain options should be handled when giving them
to GnuPG, as GnuPG's argument handling seems to have changed a lot in the
long time I've known it. I understand that much of this arises from
GnuPG's notion of 'option' arguments versus 'command' arguments.

Currently, when the user want the module to clearsign a message, this is
considered a supplement to to general notion of signing the message. The
module implements this, however, by calling GnuPG with:

gpg --clearsign

I now notice that GnuPG now graciously handles:

gpg --sign --clearsign

What is the 'preferred' call? As I am developing for a module, I need to
heavily think about forward compatibility. The same question go for
detached signatures; interestingly, '--clearsign' seems to override
'--detach-sig'.

If there is any reference library that interacts with GnuPG I'd like to
know about it. I'd use mutt, except for the fact it is not a library; it
conforms to a strict routine, if I'm not mistaken. I've once looked at
pgpglue but that seems sorely out of date.

--
Frank Tobin http://www.neverending.org/~ftobin/

"To learn what is good and what is to be valued,
those truths which cannot be shaken or changed." Myst: The Book of Atrus

OpenPGP: 4F86 3BBB A816 6F0A 340F 6003 56FF D10A 260C 4FA3
Re: having a library pass GnuPG options [ In reply to ]
On Sun, 16 Jan 2000, Frank Tobin wrote:

> I now notice that GnuPG now graciously handles:
>
> gpg --sign --clearsign
>
> What is the 'preferred' call? As I am developing for a module, I need to
> heavily think about forward compatibility. The same question go for
> detached signatures; interestingly, '--clearsign' seems to override
> '--detach-sig'.

gpg --clearsign

The problem arises from the compatibilty to PGP 2, there are some ugly
hacks to implement most of PGP's commandline syntax. That is the
reason why you sometimes don't get the error: conflicting commands.
I'd suggest to use only one command, so:

--sign for standard signing
--detach-sign for detached signatures
--clearsign for cleartext signatures

These are guaranteed to work for any later versions. Maybe I can
change the error reporting in futrue, so that you get an error wenh
using conflicting long commands..

> conforms to a strict routine, if I'm not mistaken. I've once looked at
> pgpglue but that seems sorely out of date.

We should really work again on this thing.

--
Werner Koch at guug.de www.gnupg.org keyid 621CC013

Boycott Amazon! - http://www.gnu.org/philosophy/amazon.html