Mailing List Archive

Perl interface to GnuPG functionality
Greetings!

Does anyone have plans for a Perl module which would offer the
functionality of gpg? I'm not thinking of something which would
run the gpg executable, but a "Perl extension" which makes use
of the C code directly.

Any takers?

May blessings from the eternal God surprise and overtake you!
Norbert.

--
Norbert Bollow, Zuerich, Switzerland. Backup e-mail address: NB@POBOX.COM
Re: Perl interface to GnuPG functionality [ In reply to ]
In message <199808211041.MAA00437@quill>, Norbert Bollow writes:
>Greetings!
>
>Does anyone have plans for a Perl module which would offer the
>functionality of gpg? I'm not thinking of something which would
>run the gpg executable, but a "Perl extension" which makes use
>of the C code directly.

I really don't understand what you mean here. The perl program would _not_
run gpg, is that correct?

If so, I don't get it. Are you talking about writing gpg in perl or what?

-Robin
Re: Perl interface to GnuPG functionality [ In reply to ]
Robin Lee Powell writes:

> If so, I don't get it. Are you talking about writing gpg in perl or what?

No I'm talking of the kind of thing which is called "Extension modules"
in 'man perlmodlib'.

This allow would to write something like

use GnuPG;
$result=clearsign(data=>$message, key=>$signature_key, passwd=>$passwd);

in my Perl programs, and I don't want the GnuPG module to execute an
external program.

No it's not necessary to reimplement everything in Perl, the existing C
code can be used.

BTW, the reason why I'm asking is that we need something like this for
the Majordomo2 project.

-- NB.
Re: Perl interface to GnuPG functionality [ In reply to ]
At around Fri, 21 Aug 1998 18:08:40 +0200 (CEST),
Norbert Bollow <nb@thinkcoach.com> may have mentioned:

> Robin Lee Powell writes:
>
> > If so, I don't get it. Are you talking about writing gpg in perl or what?
>
> No I'm talking of the kind of thing which is called "Extension modules"
> in 'man perlmodlib'.
>
> This allow would to write something like
>
> use GnuPG;
> $result=clearsign(data=>$message, key=>$signature_key, passwd=>$passwd);
>
> in my Perl programs, and I don't want the GnuPG module to execute an
> external program.
>
> No it's not necessary to reimplement everything in Perl, the existing C
> code can be used.
>
> BTW, the reason why I'm asking is that we need something like this for
> the Majordomo2 project.

some of us discussed similar topics w/ werner a while back (basically
it would be nice to have a library interface which you could use xs-stuff
to talk to, right?), but at that point in the development there were
other priorities :-)

i would very much like to see a library version as well, as that would
make it easy to also create interfaces for other pls such as python
(i'm a perl fan too) as well as being used from c, so we could build a
pgp-aware ezmlm, for instance.

<off-topic note>
there is a write-up of some of the dicussions that fred lindberg and
i had about making a mailing list use pgp/gpg in various ways at:

http://www.htp.org/~sen/design/cipherml.html

in case anyone is interested (for reference, ideas, something to
criticize, etc. :-) )

-sen
Re: Perl interface to GnuPG functionality [ In reply to ]
At around Fri, 21 Aug 1998 09:55:32 -0400,
Robin Lee Powell <rlpowell@calum.csclub.uwaterloo.ca> may have mentioned:

> In message <199808211041.MAA00437@quill>, Norbert Bollow writes:
> >Greetings!
> >
> >Does anyone have plans for a Perl module which would offer the
> >functionality of gpg? I'm not thinking of something which would
> >run the gpg executable, but a "Perl extension" which makes use
> >of the C code directly.
>
> I really don't understand what you mean here. The perl program would _not_
> run gpg, is that correct?
>
> If so, I don't get it. Are you talking about writing gpg in perl or what?

he is talking about wanting to call gpg code from perl -- there is a
way to provide access to functionality provided via c code inside
perl.

here is a rough explanation of the process:

one creates glue code between the c source code and perl. this
usually manifests itself in the form of a 'module'. once the module
is included/ loaded (w/ something like 'use'), you can make perl
function calls which are translated (along w/ arguments) into c -- the
c code is then called and the results are translated back into perl.

this is possible in both perl and python (probably other
languages as well). IIRC, there's also a package called swig
that facilitates this process somewhat independent of language --
though it tends to work better for fairly simple interfaces.

if there were a gpg library, this would probably (first impression) be
fairly easy to do -- get something working anyway...making it fairly
secure might be quite a bit of work. it's possible to do this w/o a
library interface but imho, it's likely to become much more messy and
harder to maintain as the original software develops.

does this make any sense?

-sen