File Coverage

blib/lib/Crypt/SSLeay/X509.pm
Criterion Covered Total %
statement n/a
branch n/a
condition n/a
subroutine n/a
pod n/a
total n/a


line stmt bran cond sub pod time code
1             package Crypt::SSLeay::X509;
2              
3             sub not_before {
4                 my $cert=shift;
5                 my $not_before_string=$cert->get_notBeforeString;
6                 &not_string2time($not_before_string);
7             }
8              
9             sub not_after {
10                 my $cert=shift;
11                 my $not_after_string=$cert->get_notAfterString;
12                 &not_string2time($not_after_string);
13             }
14              
15             sub not_string2time {
16                 my $string = shift;
17             # $string has the form 021019235959Z
18                 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                 $year += 2000;
21                 my $time="$year-$month-$day $hour:$minute:$second";
22                 $time .= " GMT" if $GMT;
23                 $time;
24             }
25              
26             1;
27