Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
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 wandering the Monastery: (10)
As of 2014-10-02 07:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    What is your favourite meta-syntactic variable name?














    Results (49 votes), past polls