Subject: | The get_algorithm_class method should use its own objects algorithm |
I think the get_algorithm_class methods of Mail::DKIM::Signature and
Mail::DKIM::DkSignature should take no arguments and should return the
class appropriate for $self->algorithm.
As things currently stand (in 0.26), when
Mail::DKIM::Signer::add_signature creates a new algorithm, it passes
$signer->{Algorithm} to $signature->get_algorithm_class. This ends up
(incorrectly) creating an algorithm object appropriate for
$signer->{Algorithm} rather than $signature->algorithm.
This makes it impossible to use a single Signer to generate multiple
signatures, if the signatures have different algorithms. One might,
for example, want to generate both a DKIM sig (with a=relaxed) and a
DomainKey sig (with a=nofws). (If both signatures use the same
algorithm (e.g. a=simple), then this can be done, currently by using a
signer policy which calls $signer->add_signature once for each signature.)