blib/lib/Crypt/Perl/X509/Extension/tlsFeature.pm untested

filter: Statementstmt 0.0% 0 / 32 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 9 Podpod 0.0% 0 / 2 totaltotal 0.0% 0 / 45 CC 2 SCAR 10.3
CC
2
Cov
0%
new
6.0
_encode_params
2.0
BEGIN
2.0
CRAP 2.8
1 package Crypt::Perl::X509::Extension::tlsFeature;
2  
3 use strict;
4 use warnings;
5  
6 =encoding utf-8
7  
8 =head1 NAME
9  
10 Crypt::Perl::X509::Extension::tlsFeature
11  
12 =head1 SYNOPSIS
13  
14 my $usage_obj = Crypt::Perl::X509::Extension::tlsFeature->new( 5 );
15  
16 =head1 SEE ALSO
17  
18 L<https://tools.ietf.org/pdf/rfc7633.pdf>
19  
20 =cut
21  
22 use parent qw( Crypt::Perl::X509::Extension );
23  
24 use constant OID => '1.3.6.1.5.5.7.1.24';
25  
26 use constant CRITICAL => 0;
27  
28 use constant ASN1 => <<END;
29 tlsFeature ::= SEQUENCE OF INTEGER
30 END
31  
32 use Crypt::Perl::X ();
33  
34 #OpenSSL crypto/x509v3/v3_tlsf.c
35 my %values = (
36 status_request => 5,
37 status_request_v2 => 17,
38 );
39  
40 sub new {
41 my ($class, @strs) = @_;
42  
43 my @ints;
44 for my $v (@strs) {
45 if (!$values{$v}) {
46 die Crypt::Perl::X::create('Generic', "Unknown TLS feature string: ā€œ$vā€");
47 }
48  
49 push @ints, $values{$v};
50 }
51  
52 return bless \@ints, $class;
53 }
54  
55 sub _encode_params {
56 my ($self) = @_;
57  
58 return [ @$self ];
59 }
60  
61 1;