line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
4
|
|
|
4
|
|
1824
|
use strict; |
|
4
|
|
|
|
|
6
|
|
|
4
|
|
|
|
|
156
|
|
2
|
4
|
|
|
4
|
|
17
|
use warnings; |
|
4
|
|
|
|
|
4
|
|
|
4
|
|
|
|
|
165
|
|
3
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
package Tiny::OpenSSL::Subject; |
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
# ABSTRACT: X509 Subject object. |
7
|
|
|
|
|
|
|
our $VERSION = '0.1.1'; # VERSION |
8
|
|
|
|
|
|
|
|
9
|
4
|
|
|
4
|
|
519
|
use Moo; |
|
4
|
|
|
|
|
18048
|
|
|
4
|
|
|
|
|
42
|
|
10
|
4
|
|
|
4
|
|
3670
|
use Types::Standard qw( Str InstanceOf Int ); |
|
4
|
|
|
|
|
56086
|
|
|
4
|
|
|
|
|
32
|
|
11
|
4
|
|
|
4
|
|
2808
|
use Tiny::OpenSSL::Config qw($CONFIG); |
|
4
|
|
|
|
|
8
|
|
|
4
|
|
|
|
|
933
|
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
has [ keys %{ $CONFIG->{san} } ] => ( is => 'rw', isa => Str ); |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
sub dn { |
16
|
3
|
|
|
3
|
1
|
9828
|
my $self = shift; |
17
|
|
|
|
|
|
|
|
18
|
3
|
|
|
|
|
6
|
my @subject; |
19
|
|
|
|
|
|
|
|
20
|
3
|
|
|
|
|
15
|
my @methods = |
21
|
|
|
|
|
|
|
qw( country state locality organization organizational_unit commonname ); |
22
|
|
|
|
|
|
|
|
23
|
3
|
|
|
|
|
7
|
for my $method (@methods) { |
24
|
|
|
|
|
|
|
|
25
|
18
|
50
|
|
|
|
303
|
if ( $self->$method ) { |
26
|
18
|
|
|
|
|
62677
|
push @subject, |
27
|
|
|
|
|
|
|
sprintf( '%s=%s', $CONFIG->{san}{$method}, $self->$method ); |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
|
31
|
3
|
|
|
|
|
53
|
return sprintf( '/%s', join( '/', @subject ) ); |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
1; |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
__END__ |