Subject: | Crypt::OpenPGP::Key should die if algorithm unsupported |
If Crypt::OpenPGP::Key is asked to find a key with an algorithm that
doesn't have a corresponding package installed, it will return an error
(i.e. these lines from new()):
eval "use $pkg;";
return $class->error("Unsupported algorithm '$alg': $@") if $@;
I had a system that didn't have Crypt::RSA installed (my mistake), but
it took me a long time to track down the problem. I had some code like this:
$sec_ring->find_keyblock_by_keyid( pack("H*", $key_id) ) or croak
"Error:" . $sec_ring->error;
find_keyblock_by_keyid() was returning false, and the code croaked (with
nothing in the sec ring error), but it wasn't obvious what caused the
problem. I thought it was to do with it not being able to find the key
rings, etc. It would've been much more obvious what the problem was if
Crypt::OpenPGP::Key had died.