Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

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:

http://search.cpan.org/grep?cpanid=BTROTT&release=Crypt-OpenPGP-1.06&string=key_id_hex&i=1&n=1&C=0 shows that your upack-suggestion is indeed just what is needed:

lib/Crypt/OpenPGP/Certificate.pm 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";


Comment on Re^6: Stumped by Crypt::OpenPGP::Signature->key_id
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (7)
As of 2015-07-30 00:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (269 votes), past polls