Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??

I think I've isolated the problem: when I ran the script as myself, the script was using my personal keyring, not the one I'm passing it. For some reason, the keyring I'm trying to create in the program isn't working. I've reduced the problem to this script; if I can get this to work, I believe I can make the larger program run as well.

#! /usr/bin/perl use strict; use Crypt::OpenPGP; my $gpg = Crypt::OpenPGP->new or die "Cannot create Crypt object: $!"; my $ring = Crypt::OpenPGP::KeyRing->new( Data => \*DATA ) or die "Cannot create keyring: $!"; my $plaintext = 'Foobar!'; my $cipher = $gpg->encrypt( Compat => 'GnuPG', PubRing => $ring, Data => $plaintext, Armour => 1, Recipients => 'douggorley@shaw.ca' ) or die "Cannot encrypt text: " . $gpg->errstr; print "$cipher"; __DATA__ -----BEGIN PGP PUBLIC KEY BLOCK----- Version: GnuPG v1.2.2 (GNU/Linux) mQGiBDwTwfQRBADH+C+xkm3V3rFywQJw9IwkbNKifRxn47GSZEOOTxNn6IupqqGi lO7BndliHsBQEqqalQchv6Ly8Djxl0aeS5MweCT1qrlrtkMtbqYtDcyp10x2iTcC 4MA5dU1/P/TdhEQQSAgSFbt3qE2ZnK3wsai2CdEFR47xAKG6NKwmMPeUAwCg+61C gaMddxI+5/kzoCGomqGmcI8D/2qculnwGTeNyDH5EKJnb0w2Cjb7jmxe8RtAOKEx 3hApV18Ng5dWiEuId8TmAYoQiHyC09vv9L0lADysTNrzfH8ozXZwXJlcIYFg/Doi jtUleX0mmZVSUkrJJ+rybT8jcfcWso2wa/igLjTyWHwXqPdkLf3zDOM8V1KJO1zj Og3BBAC5j0iM3vKvkU0KXt9A2i+0Pz+xPIrUc3XUVVHntq9nhOPOhbckHF81tfTu UnKFPQhiHmYFSoqhwMuPvMGvq3URs29WsCUGjX1gcoMkinOkAeOLQwwNh3MxMAri d0GFaeQPUK0V4uG5HDRG6Ggs95mfF3TjO3bcjikR+xzEd+cIv7QgRG91ZyBHb3Js ZXkgPGRvdWdnb3JsZXlAc2hhdy5jYT6IWgQTEQIAGgULBwoDBAMVAwIDFgIBAheA AhkBBQI8E8H1AAoJEMWpVBWiIVWb8OcAoPQ+2Rz3aQ6nsVBNFGRbN6XBHhoOAJ4v TWlEp4vz3/seWpJu8Eusd9eH0ohGBBARAgAGBQI+XGA+AAoJEIIiaBYBnUdP6X8A ni7yhBPc37MatJad9tKO1m/FKXv/AKCHC0hIIr0rSPl5oWt265Cit228KrkBDQQ8 E8H6EAQAhSB8LOS83dcRvxpq8k3y9SfzthnQyDtJRi/6qaE7+LCSPzx4SDfxP1Sn r/ScPceqTP54GR51nYLTv9abm75SIbcgkwUQx2U0q5XM3UjZB2ZJxLQ1bOxhFJpn F8PX9PtDm77e3zitCRdoBlXyKcKCnDKSAhp2B9hhD9eOj6i9ah8AAwcD/itF9KhK sUr/SD33ToPJ216aTx9aQ2iyWMcQ4hEaTq0bLN8UOBLvwFYglUdA1wUjrEUKK9QC ptfb5+/CibNvjTuP6M+087OmX/BFKLIhfO9oQlp3RV1u9futp1tzTlRo2F0uI1YV mAIHNuildXCSCuTEkctQlujqMSJ5E1B1dYr3iEYEGBECAAYFAjwTwfoACgkQxalU FaIhVZsCNgCfWHmXo/me0717bsT38c55Uqfrng0AoLTOcDzWdHln4MhLBOQ+RVN6 u0sd =NtKC -----END PGP PUBLIC KEY BLOCK-----

_______________
DamnDirtyApe
Those who know that they are profound strive for clarity. Those who
would like to seem profound to the crowd strive for obscurity.
            --Friedrich Nietzsche

In reply to Re: Problem with module using Crypt::OpenPGP by DamnDirtyApe
in thread Problem with module using Crypt::OpenPGP by DamnDirtyApe

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others musing on the Monastery: (6)
    As of 2020-07-05 11:24 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      No recent polls found

      Notices?