lib/Crypt/Perl/X509/Extension/policyMappings.pm

filter: Statementstmt 100% 30 / 30 Branchbran 50.0% 1 / 2 Conditioncond 66.6% 4 / 6 MC/DCmcdc 25.0% 1 / 4 Subroutinesub 100% 7 / 7 Podpod 0.0% 0 / 1 totaltotal 86.0% 43 / 50 CC 6 SCAR 12.7
CC
6
Cov
92%
new
6.1
BEGIN
1.0
BEGIN
1.0
CRAP 3.6
« blib/lib/Crypt/Perl/X/ECDSA/CharacteristicTwoUnsupported.pm ↑ Summary blib/lib/Crypt/Perl/ECDSA/PrivateKey.pm »
1 package Crypt::Perl::X509::Extension::policyMappings;
2  
3 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 =encoding utf-8
7  
8 =head1 NAME
9  
10 Crypt::Perl::X509::Extension::policyMappings - X.509 policyMappings extension
11  
12 =head1 SEE ALSO
13  
14 L<https://tools.ietf.org/html/rfc5280#section-4.2.1.5>
15  
16 =cut
17  
18 1 ▶use parent qw( Crypt::Perl::X509::Extension );
Subroutine BEGIN: called CC=1 SCAR=0.0
19  
20 use constant {
21 1 OID => '2.5.29.33',
22 OID_anyPolicy => '2.5.29.32.0',
23 CRITICAL => 1,
24 1 ▶};
Subroutine BEGIN: called CC=1 SCAR=0.0
25  
26 1 ▶use constant ASN1 => <<END;
Subroutine BEGIN: called CC=1 SCAR=0.0
27 policyMappings ::= SEQUENCE OF SEQUENCE {
28 issuerDomainPolicy OBJECT IDENTIFIER,
29 subjectDomainPolicy OBJECT IDENTIFIER
30 }
31 END
32  
33 sub new {
34 6 ▶ my ($class, @mappings) = @_;
Subroutine new: called CC=6 SCAR=18.1
Pod undocumented
35  
36 6 my @self;
37  
38 6 for my $m_hr (@mappings) {
39 12 my %cur;
40  
41 12 for my $k ( qw( issuer subject ) ) {
42 24 ▶ next if !defined $m_hr->{$k};
Branch: 1 branch
BranchTrueFalseTotal
unless defined $m_hr->{$k} 0 24 24
43  
44 24 my $oid = $class->can("OID_$m_hr->{$k}");
45 24 ▶ $oid &&= $oid->();
Condition66%2/3
$oid &&= &$oid()
!ll&&!rl&&r
12012
MC/DC50%1/2
$oid &&= &$oid()
$oid &$oid()
Truth table66%2/3
A &&= B
A= $oidB= &$oid()
ABresult
0X0
100
111
46 24 ▶ $oid ||= $m_hr->{$k};
Condition66%2/3
$oid ||= $m_hr->{$k}
l!l&&r!l&&!r
12120
MC/DC0%0/2
$oid ||= $m_hr->{$k}
$oid $m_hr->{$k}
Truth table66%2/3
A ||= B
A= $oidB= $m_hr->{$k}
ABresult
1X1
011
000
47  
48 24 $cur{"${k}DomainPolicy"} = $oid;
49 }
50  
51 12 push @self, \%cur;
52 }
53  
54 6 return bless \@self, $class;
55 }
56  
57 sub _encode_params {
58 6 ▶ my ($self) = @_;
Subroutine _encode_params: called CC=1 SCAR=0.0
59  
60 6 return [ @$self ];
61 }
62  
63 1 1;
« blib/lib/Crypt/Perl/X/ECDSA/CharacteristicTwoUnsupported.pm ↑ Summary blib/lib/Crypt/Perl/ECDSA/PrivateKey.pm »