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