Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris

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

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

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

Thank you! A combo of your posts and some further reading on key id formats did it: shows that your upack-suggestion is indeed just what is needed:

lib/Crypt/OpenPGP/ 106:sub key_id_hex { uc unpack 'H*', $_[0]->key_id }

I just didn't recognize the result since I was expecting the short key ID format and that outputs the long format.

The solution is:

print "KeyID hex long: 0x", uc unpack('H*', $sigobj->key_id) + ,"\n"; print "KeyID hex short: 0x",uc substr( unpack('H*', $sigobj->key_id), +-8, 8),"\n";

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://939464]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (7)
As of 2016-10-28 07:01 GMT
Find Nodes?
    Voting Booth?
    How many different varieties (color, size, etc) of socks do you have in your sock drawer?

    Results (376 votes). Check out past polls.