Branch Coverage

blib/lib/Crypt/OpenPGP/Certificate.pm
Criterion Covered Total %
branch 43 70 61.4


line true false branch
40 4 61 if (my $key = $param{'Key'})
47 2 2 if ($cert->{'version'} < 4)
49 0 2 unless $key->alg eq 'RSA'
54 2 2 if ($cert->{'is_secret'})
56 0 2 unless $param{'Passphrase'}
77 28 0 if @_
83 6 3 unless $cert->is_secret
88 0 3 if $cert->{'version'} < 4
95 58 78 unless ($cert->{'key_id'})
96 8 50 if ($cert->{'version'} < 4) { }
110 3 47 unless ($cert->{'fingerprint'})
111 0 3 if ($cert->{'version'} < 4) { }
150 11 47 if ($cert->{'version'} < 4)
155 32 26 $secret ? :
156 0 58 unless my $key = $cert->{'key'} = $key_class->new($cert->{'pk_alg'})
164 47 11 if ($cert->{'version'} >= 4)
169 32 26 if ($secret)
171 32 0 if ($cert->{'cipher'})
173 32 0 if ($cert->{'cipher'} == 255 or $cert->{'cipher'} == 254) { }
186 32 0 if ($cert->{'is_protected'}) { }
187 0 32 if ($cert->{'version'} < 4) { }
219 3 6 if ($cert->{'version'} < 4)
230 0 9 if ($cert->{'key'}->is_secret)
231 0 0 if ($cert->{'cipher'}) { }
237 0 0 if ($cert->{'version'} < 4) { }
273 0 8 unless $cert->{'is_secret'} and $cert->{'is_protected'}
275 0 8 unless my $cipher = 'Crypt::OpenPGP::Cipher'->new($cert->{'cipher'})
280 0 8 if ($cert->{'version'} < 4) { }
287 0 0 unless ($cert->{'csum'} == $cert->v3_checksum)
294 0 0 unless ($cert->{'key'}->check)
301 0 8 if ($cert->{'sha1check'}) { }
304 0 0 unless ($dgst->hash($decrypted) eq $csum)
310 0 8 unless ($csum == $gen_csum)
328 0 2 if not $cert->{'is_secret'} or $cert->{'is_protected'}
335 1 1 if ($cert->{'version'} < 4) { }