line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Crypt::Perl::X509::Extension::extKeyUsage; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
466
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
24
|
|
4
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
27
|
|
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
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
4
|
|
15
|
|
|
|
|
|
|
|
16
|
1
|
|
|
1
|
|
50
|
use Crypt::Perl::X (); |
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
25
|
|
17
|
|
|
|
|
|
|
|
18
|
1
|
|
|
1
|
|
7
|
use constant OID => '2.5.29.37'; |
|
1
|
|
|
|
|
7
|
|
|
1
|
|
|
|
|
65
|
|
19
|
|
|
|
|
|
|
|
20
|
1
|
|
|
1
|
|
5
|
use constant ASN1 => <
|
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
64
|
|
21
|
|
|
|
|
|
|
extKeyUsage ::= SEQUENCE OF KeyPurposeId |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
KeyPurposeId ::= OBJECT IDENTIFIER |
24
|
|
|
|
|
|
|
END |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
use constant { |
27
|
1
|
|
|
|
|
269
|
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
|
|
6
|
}; |
|
1
|
|
|
|
|
2
|
|
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
sub new { |
36
|
6
|
|
|
6
|
0
|
33
|
my ($class, @purposes) = @_; |
37
|
|
|
|
|
|
|
|
38
|
6
|
50
|
|
|
|
25
|
if (!@purposes) { |
39
|
0
|
|
|
|
|
0
|
die Crypt::Perl::X::create('Generic', 'Need purposes!'); |
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
|
42
|
6
|
|
|
|
|
47
|
return bless \@purposes, $class; |
43
|
|
|
|
|
|
|
} |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
sub _encode_params { |
46
|
6
|
|
|
6
|
|
16
|
my ($self) = @_; |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
my $data = [ |
49
|
|
|
|
|
|
|
map { |
50
|
6
|
50
|
|
|
|
37
|
if ( !$self->can("OID_$_") ) { |
|
36
|
|
|
|
|
160
|
|
51
|
0
|
|
|
|
|
0
|
die( Crypt::Perl::X::create('Generic', "Unknown usage: “$_”") ), |
52
|
|
|
|
|
|
|
} |
53
|
|
|
|
|
|
|
|
54
|
36
|
|
|
|
|
138
|
$self->can("OID_$_")->(); |
55
|
|
|
|
|
|
|
} @$self, |
56
|
|
|
|
|
|
|
]; |
57
|
|
|
|
|
|
|
|
58
|
6
|
|
|
|
|
33
|
return $data; |
59
|
|
|
|
|
|
|
} |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
1; |