Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change

Re^2: Stumped by Crypt::OpenPGP::Signature->key_id

by mhi (Friar)
on Nov 22, 2011 at 11:49 UTC ( #939437=note: print w/replies, xml ) Need Help??

in reply to Re: Stumped by Crypt::OpenPGP::Signature->key_id
in thread Stumped by Crypt::OpenPGP::Signature->key_id

Sorry, but I don't see how that helps.
  • The node mentioned has nothing to do with the issue at hand.
  • The Searchlink doesn't work.
  • There is no
    Crypt::OpenPGP::Signature->key_id_hex but only
    Crypt::OpenPGP::Signature->key_id and
  • Comment on Re^2: Stumped by Crypt::OpenPGP::Signature->key_id

Replies are listed 'Best First'.
Re^3: Stumped by Crypt::OpenPGP::Signature->key_id
by Anonymous Monk on Nov 22, 2011 at 11:57 UTC

    The node mentioned has nothing to do with the issue at hand.

    Yup, just nostalgia

    The Searchlink doesn't work.

    Sorry if you have to copy/paste, at least I made it tab-key navigable (couldn't have posted the link otherwise )

    There is no Crypt::OpenPGP::Signature->key_id_hex

    Too bad, it was worth a shot

    Anyway, hex of anything is

    $ perl -le " print unpack qw/H*/, $_ for @ARGV; " 1 aSdF82 31 615364463832
       unpack('H*', $sigobj->key_id) gives me a 16-digit hex number in which I can find no similarity with the Key-ID of the actual key.

        Now I remember why I linked Crypt OpenPGP Brain twister, its a Short, Self Contained, Correct Example, in otherwords, more effective :)

        If you modify Crypt-OpenPGP-1.06\t\12-sign.t at the first verify call, you can see that this is to be expected

        my( $signer , $sigobj ) = $pgp->verify( Signature => $sig ); use DDS; die Dump( [ $key_id , $sigobj->key_id, unpack('H*', $sigo +bj->key_id ) , pack('H*',$key_id) ] );

        $ARRAY1 = [ '39F560A90D7F1559', "9\365`\251\r\177\25Y", '39f560a90d7f1559', "9\365`\251\r\177\25Y" ];

        I don't know if keyid is supposed to be 8 or 10 or 16, but the round trip with pack seems to work , so key_id is correct, and the hex representation is correct

        AFAIK printf would actually try to convert it, which might overflow as in

        $ perl -le " print 0x39f560a90d7f1559 Integer overflow in hexadecimal number at -e line 1. 4.17635050864817e+018

        Maybe this is the private key, and you're looking for the public key? Maybe it depends on algorithm? :)

Re^3: Stumped by Crypt::OpenPGP::Signature->key_id
by Anonymous Monk on Nov 24, 2011 at 12:57 UTC
    Patches Welcome™ . . .
      Well, actually I did submit a patch for this to the module's author last night. Hope to get a reply some time soon.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://939437]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (8)
As of 2018-06-25 00:30 GMT
Find Nodes?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?

    Results (126 votes). Check out past polls.