File Coverage

File:blib/lib/Crypt/SSLeay/X509.pm
Coverage:0.0%

linestmtbrancondsubpodcode
1package Crypt::SSLeay::X509;
2
3sub not_before {
4    my $cert=shift;
5    my $not_before_string=$cert->get_notBeforeString;
6    &not_string2time($not_before_string);
7}
8
9sub not_after {
10    my $cert=shift;
11    my $not_after_string=$cert->get_notAfterString;
12    &not_string2time($not_after_string);
13}
14
15sub 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
261;