line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Crypt::Perl::X509::Extension::authorityKeyIdentifier; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
856
|
use strict; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
32
|
|
4
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
40
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
=encoding utf-8 |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
=head1 NAME |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
Crypt::Perl::X509::Extension::authorityKeyIdentifier |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
=head1 SYNOPSIS |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
my $usage_obj = Crypt::Perl::X509::Extension::authorityKeyIdentifier->new( |
15
|
|
|
|
|
|
|
keyIdentifier => $key_id_octet_string, #optional |
16
|
|
|
|
|
|
|
authorityCertIssuer => [ [ dNSName => '..' ], .. ], |
17
|
|
|
|
|
|
|
authorityCertSerialNumber => $auth_cert_serial_num |
18
|
|
|
|
|
|
|
); |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
=head1 SEE ALSO |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
L |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
=cut |
25
|
|
|
|
|
|
|
|
26
|
1
|
|
|
1
|
|
6
|
use parent qw( Crypt::Perl::X509::Extension ); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
9
|
|
27
|
|
|
|
|
|
|
|
28
|
1
|
|
|
1
|
|
64
|
use Crypt::Perl::X (); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
13
|
|
29
|
1
|
|
|
1
|
|
5
|
use Crypt::Perl::X509::GeneralName (); |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
23
|
|
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
use constant { |
32
|
1
|
|
|
|
|
126
|
OID => '2.5.29.35', |
33
|
|
|
|
|
|
|
CRITICAL => 0, |
34
|
1
|
|
|
1
|
|
4
|
}; |
|
1
|
|
|
|
|
3
|
|
35
|
|
|
|
|
|
|
|
36
|
1
|
|
|
1
|
|
7
|
use constant ASN1 => Crypt::Perl::X509::GeneralNames::ASN1() . <
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
317
|
|
37
|
|
|
|
|
|
|
authorityKeyIdentifier ::= SEQUENCE { |
38
|
|
|
|
|
|
|
keyIdentifier [0] OCTET STRING OPTIONAL, |
39
|
|
|
|
|
|
|
-- authorityCertIssuer [1] GeneralNames OPTIONAL, |
40
|
|
|
|
|
|
|
authorityCertIssuer ANY OPTIONAL, |
41
|
|
|
|
|
|
|
authorityCertSerialNumber [2] INTEGER OPTIONAL |
42
|
|
|
|
|
|
|
} |
43
|
|
|
|
|
|
|
END |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
my @_attrs = qw( |
46
|
|
|
|
|
|
|
keyIdentifier |
47
|
|
|
|
|
|
|
authorityCertIssuer |
48
|
|
|
|
|
|
|
authorityCertSerialNumber |
49
|
|
|
|
|
|
|
); |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
sub new { |
52
|
6
|
|
|
6
|
0
|
67
|
my ($class, %attrs) = @_; |
53
|
|
|
|
|
|
|
|
54
|
6
|
50
|
|
|
|
39
|
if (!grep { defined } @attrs{ @_attrs }) { |
|
18
|
|
|
|
|
48
|
|
55
|
0
|
|
|
|
|
0
|
die Crypt::Perl::X::create('Generic', "Need one of: [@_attrs]"); |
56
|
|
|
|
|
|
|
} |
57
|
|
|
|
|
|
|
|
58
|
6
|
|
|
|
|
51
|
return bless \%attrs, $class; |
59
|
|
|
|
|
|
|
} |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
sub _encode_params { |
62
|
6
|
|
|
6
|
|
21
|
my ($self) = @_; |
63
|
|
|
|
|
|
|
|
64
|
6
|
|
|
|
|
13
|
my %params; |
65
|
|
|
|
|
|
|
|
66
|
6
|
|
|
|
|
17
|
for my $a ( @_attrs ) { |
67
|
18
|
50
|
|
|
|
74
|
next if !defined $self->{$a}; |
68
|
18
|
|
|
|
|
45
|
$params{$a} = $self->{$a}; |
69
|
|
|
|
|
|
|
} |
70
|
|
|
|
|
|
|
|
71
|
6
|
50
|
|
|
|
30
|
if ( $params{'authorityCertIssuer'} ) { |
72
|
|
|
|
|
|
|
#$params{'authorityCertIssuer'} = Crypt::Perl::X509::GeneralNames->new( @{ $params{'authorityCertIssuer'} } )->_encode_params(); #XXX FIXME |
73
|
|
|
|
|
|
|
|
74
|
6
|
|
|
|
|
13
|
$params{'authorityCertIssuer'} = Crypt::Perl::X509::GeneralNames->new( @{ $params{'authorityCertIssuer'} } )->encode(); |
|
6
|
|
|
|
|
89
|
|
75
|
6
|
|
|
|
|
733
|
substr( $params{'authorityCertIssuer'}, 0, 1 ) = "\xa1"; |
76
|
|
|
|
|
|
|
} |
77
|
|
|
|
|
|
|
|
78
|
6
|
|
|
|
|
26
|
return \%params; |
79
|
|
|
|
|
|
|
} |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
1; |