Branch Coverage

blib/lib/Mail/DKIM/PrivateKey.pm
Criterion Covered Total %
branch 20 34 58.8


line true false branch
30 17 28 if ($prms{'Data'}) { }
28 0 elsif (defined $prms{'File'}) { }
0 0 elsif ($prms{'Cork'}) { }
35 2 26 unless open my $file, "<", $prms{'File'}
39 52 314 if $line =~ /^---/
75 0 37 unless (eval { do { local $SIG{'__DIE__'}; $cork = "Crypt::OpenSSL::RSA"->new_private_key($pkcs); 1 } })
80 0 37 unless $cork
106 0 2 unless $cork->import_key(\$pem)
114 0 2 unless (eval { do { local $SIG{'__DIE__'}; $cork = "Crypt::PK::Ed25519"->new; my $pem = "-----BEGIN ED25519 PRIVATE KEY-----\n"; $pem .= $self->data; $pem .= "\n"; $pem .= "-----END ED25519 PRIVATE KEY-----\n"; die "failed to load Ed25519 private key" unless $cork->import_key(\$pem); 1 } })
119 0 2 unless $cork
129 0 39 unless $self->data
132 37 2 if $self->{'TYPE'} eq "rsa"
133 2 0 if $self->{'TYPE'} eq "ed25519"
170 0 2 unless ($ed)
171 0 0 $@ ne '' ? :
181 57 2 if $self->{'TYPE'} eq "rsa"
182 2 0 if $self->{'TYPE'} eq "ed25519"