File Coverage

blib/lib/Crypt/SSLeay/X509.pm
Criterion Covered Total %
statement 3 13 23.0
branch 0 2 0.0
condition n/a
subroutine 1 4 25.0
pod 0 3 0.0
total 4 22 18.1


line stmt bran cond sub pod time code
1             package Crypt::SSLeay::X509;
2              
3 3     3   11 use strict;
  3         2  
  3         404  
4              
5             sub not_before {
6 0     0 0   my $cert = shift;
7 0           not_string2time($cert->get_notBeforeString);
8             }
9              
10             sub not_after {
11 0     0 0   my $cert = shift;
12 0           not_string2time($cert->get_notAfterString);
13             }
14              
15             sub not_string2time {
16 0     0 0   my $string = shift;
17             # $string has the form 021019235959Z
18 0           my($year, $month, $day, $hour, $minute, $second, $GMT)=
19             $string=~m/(\d\d)(\d\d)(\d\d)(\d\d)(\d\d)(\d\d)(Z)?/;
20 0           $year += 2000;
21 0           my $time="$year-$month-$day $hour:$minute:$second";
22 0 0         $time .= " GMT" if $GMT;
23 0           $time;
24             }
25              
26             1;