line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
4
|
|
|
4
|
|
1799
|
use strict; |
|
4
|
|
|
|
|
6
|
|
|
4
|
|
|
|
|
191
|
|
2
|
4
|
|
|
4
|
|
16
|
use warnings; |
|
4
|
|
|
|
|
5
|
|
|
4
|
|
|
|
|
157
|
|
3
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
package Tiny::OpenSSL::Subject; |
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
# ABSTRACT: X509 Subject object. |
7
|
|
|
|
|
|
|
our $VERSION = '0.1.2'; # VERSION |
8
|
|
|
|
|
|
|
|
9
|
4
|
|
|
4
|
|
448
|
use Moo; |
|
4
|
|
|
|
|
11375
|
|
|
4
|
|
|
|
|
18
|
|
10
|
4
|
|
|
4
|
|
2235
|
use Types::Standard qw( Str InstanceOf Int ); |
|
4
|
|
|
|
|
49672
|
|
|
4
|
|
|
|
|
36
|
|
11
|
4
|
|
|
4
|
|
2686
|
use Tiny::OpenSSL::Config qw($CONFIG); |
|
4
|
|
|
|
|
7
|
|
|
4
|
|
|
|
|
947
|
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
has [ keys %{ $CONFIG->{san} } ] => ( is => 'rw', isa => Str ); |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
sub dn { |
16
|
4
|
|
|
4
|
1
|
11065
|
my $self = shift; |
17
|
|
|
|
|
|
|
|
18
|
4
|
|
|
|
|
56
|
my @subject; |
19
|
|
|
|
|
|
|
|
20
|
4
|
|
|
|
|
26
|
my @methods = |
21
|
|
|
|
|
|
|
qw( country state locality organization organizational_unit commonname ); |
22
|
|
|
|
|
|
|
|
23
|
4
|
|
|
|
|
13
|
for my $method (@methods) { |
24
|
|
|
|
|
|
|
|
25
|
24
|
50
|
|
|
|
321
|
if ( $self->$method ) { |
26
|
24
|
|
|
|
|
12467
|
push @subject, |
27
|
|
|
|
|
|
|
sprintf( '%s=%s', $CONFIG->{san}{$method}, $self->$method ); |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
|
31
|
4
|
|
|
|
|
67
|
return sprintf( '/%s', join( '/', @subject ) ); |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
1; |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
__END__ |