line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
5
|
|
|
5
|
|
3079
|
use strict; |
|
5
|
|
|
|
|
12
|
|
|
5
|
|
|
|
|
128
|
|
2
|
5
|
|
|
5
|
|
24
|
use warnings; |
|
5
|
|
|
|
|
10
|
|
|
5
|
|
|
|
|
270
|
|
3
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
package Tiny::OpenSSL::Subject; |
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
# ABSTRACT: X509 Subject object. |
7
|
|
|
|
|
|
|
our $VERSION = '0.1.3'; # VERSION |
8
|
|
|
|
|
|
|
|
9
|
5
|
|
|
5
|
|
730
|
use Moo; |
|
5
|
|
|
|
|
13332
|
|
|
5
|
|
|
|
|
62
|
|
10
|
5
|
|
|
5
|
|
3327
|
use Types::Standard qw( Str InstanceOf Int ); |
|
5
|
|
|
|
|
62004
|
|
|
5
|
|
|
|
|
46
|
|
11
|
5
|
|
|
5
|
|
4096
|
use Tiny::OpenSSL::Config qw($CONFIG); |
|
5
|
|
|
|
|
12
|
|
|
5
|
|
|
|
|
1301
|
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
has [ keys %{ $CONFIG->{san} } ] => ( is => 'rw', isa => Str ); |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
sub dn { |
16
|
5
|
|
|
5
|
1
|
12472
|
my $self = shift; |
17
|
|
|
|
|
|
|
|
18
|
5
|
|
|
|
|
12
|
my @subject; |
19
|
|
|
|
|
|
|
|
20
|
5
|
|
|
|
|
32
|
my @methods = |
21
|
|
|
|
|
|
|
qw( country state locality organization organizational_unit commonname ); |
22
|
|
|
|
|
|
|
|
23
|
5
|
|
|
|
|
25
|
for my $method (@methods) { |
24
|
|
|
|
|
|
|
|
25
|
30
|
100
|
|
|
|
3494
|
if ( $self->$method ) { |
26
|
|
|
|
|
|
|
push @subject, |
27
|
25
|
|
|
|
|
11590
|
sprintf( '%s=%s', $CONFIG->{san}{$method}, $self->$method ); |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
|
31
|
5
|
|
|
|
|
85
|
return sprintf( '/%s', join( '/', @subject ) ); |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
1; |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
__END__ |