line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Crypt::Perl::X509::Extension::extKeyUsage; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
521
|
use strict; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
26
|
|
4
|
1
|
|
|
1
|
|
4
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
30
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
=encoding utf-8 |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
=head1 NAME |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
Crypt::Perl::X509::Extension::extKeyUsage |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
=cut |
13
|
|
|
|
|
|
|
|
14
|
1
|
|
|
1
|
|
5
|
use parent qw( Crypt::Perl::X509::Extension ); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
7
|
|
15
|
|
|
|
|
|
|
|
16
|
1
|
|
|
1
|
|
67
|
use Crypt::Perl::X (); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
25
|
|
17
|
|
|
|
|
|
|
|
18
|
1
|
|
|
1
|
|
7
|
use constant OID => '2.5.29.37'; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
56
|
|
19
|
|
|
|
|
|
|
|
20
|
1
|
|
|
1
|
|
4
|
use constant ASN1 => <
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
61
|
|
21
|
|
|
|
|
|
|
extKeyUsage ::= SEQUENCE OF KeyPurposeId |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
KeyPurposeId ::= OBJECT IDENTIFIER |
24
|
|
|
|
|
|
|
END |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
use constant { |
27
|
1
|
|
|
|
|
277
|
OID_serverAuth => '1.3.6.1.5.5.7.3.1', |
28
|
|
|
|
|
|
|
OID_clientAuth => '1.3.6.1.5.5.7.3.2', |
29
|
|
|
|
|
|
|
OID_codeSigning => '1.3.6.1.5.5.7.3.3', |
30
|
|
|
|
|
|
|
OID_emailProtection => '1.3.6.1.5.5.7.3.4', |
31
|
|
|
|
|
|
|
OID_timeStamping => '1.3.6.1.5.5.7.3.8', |
32
|
|
|
|
|
|
|
OID_OCSPSigning => '1.3.6.1.5.5.7.3.9', |
33
|
1
|
|
|
1
|
|
5
|
}; |
|
1
|
|
|
|
|
9
|
|
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
sub new { |
36
|
6
|
|
|
6
|
0
|
45
|
my ($class, @purposes) = @_; |
37
|
|
|
|
|
|
|
|
38
|
6
|
50
|
|
|
|
51
|
if (!@purposes) { |
39
|
0
|
|
|
|
|
0
|
die Crypt::Perl::X::create('Generic', 'Need purposes!'); |
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
|
42
|
6
|
|
|
|
|
51
|
return bless \@purposes, $class; |
43
|
|
|
|
|
|
|
} |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
sub _encode_params { |
46
|
6
|
|
|
6
|
|
17
|
my ($self) = @_; |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
my $data = [ |
49
|
|
|
|
|
|
|
map { |
50
|
6
|
50
|
|
|
|
46
|
if ( !$self->can("OID_$_") ) { |
|
36
|
|
|
|
|
184
|
|
51
|
0
|
|
|
|
|
0
|
die( Crypt::Perl::X::create('Generic', "Unknown usage: “$_”") ), |
52
|
|
|
|
|
|
|
} |
53
|
|
|
|
|
|
|
|
54
|
36
|
|
|
|
|
153
|
$self->can("OID_$_")->(); |
55
|
|
|
|
|
|
|
} @$self, |
56
|
|
|
|
|
|
|
]; |
57
|
|
|
|
|
|
|
|
58
|
6
|
|
|
|
|
31
|
return $data; |
59
|
|
|
|
|
|
|
} |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
1; |