D. J. Birkett wrote:
> Thomas Bätzler wrote:
> 
>> D. J. Birkett <[EMAIL PROTECTED]> asked:
>>
>>> OK I've tried altering my code as you suggested, replacing the
>>> regexes with ones that would work.  gpg still just sits there as soon
>>> as it has entered it's intereactive mode, and perl doesn't seem to be
>>> passing any commands to it at all.
>>>
>>> Any other ideas?
>>
>>
>>
>> You could always go ahead and look at Crypt::GPG to see how
>> this module does its interaction with GPG.
>>
>> http://search.cpan.org/~agul/Crypt-GPG-1.52/GPG.pm
>>
>> HTH,
>> Thomas
> 
> 
> Thanks.  I've had a look through and it appears to use IPC::Run as an
> alternative way of interacting with gpg.  Unfortunately, IPC::Run also
> is not part of the standard distro.
> 

When I was writing a set of client libraries in a similar manner,
GnuPG::Interface was by far the best around, though I don't recall
whether it went to the level you are trying (aka interacting with the
client in such a manner). The problem is that gnupg provides the
status/log/etc. fd switches that work with file descriptors (aka a pipe)
but it isn't precisely documented and the output that it provides isn't
sufficient to do everything. So in some cases (encrypt/decrypt) it works
great, in others (getting a key fingerprint information IIRC) it fails
miserably and you have to screen scrape (at least at the time I was
developing, been a while). I would check out the source for
GnuPG::Interface, and see how it works then emulate it. (The reason we
did the same is because of a forking issue unrelated to gnupg, but
related to POE::Wheel::Run. Sorry can't release code, license issues.)
If this fails you, you might post a message to the gnupg-user or
gnupg-devel mailing lists for help there.  I am glad to see Crypt::GPG
was finally upgraded, it had been languishing with deprecated methods.

As a guess it might be which switches you are passing depending on the
combination you use gpg might be passing in or out of interactive mode,
again the gnupg lists will be able to help with that.

As an aside remember that a module unless it has a compiled component
can just be included with whatever distribution your script is
requiring. Assuming you have written any of your own libraries, or are
providing documentation, etc. it would be just as easy to distribute a
module with your script as any other file. Definitely something to consider.

HTH, good luck,

http://danconia.org

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to