http://www.perlmonks.org?node_id=939464


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";