Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

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

by mhi (Friar)
on Nov 22, 2011 at 14:21 UTC ( [id://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";

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (5)
As of 2024-04-23 23:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found