Current Path : /usr/local/lib/perl5/site_perl/5.8.9/mach/Crypt/SSLeay/ |
FreeBSD hs32.drive.ne.jp 9.1-RELEASE FreeBSD 9.1-RELEASE #1: Wed Jan 14 12:18:08 JST 2015 root@hs32.drive.ne.jp:/sys/amd64/compile/hs32 amd64 |
Current File : //usr/local/lib/perl5/site_perl/5.8.9/mach/Crypt/SSLeay/X509.pm |
package Crypt::SSLeay::X509; use strict; sub not_before { my $cert = shift; not_string2time($cert->get_notBeforeString); } sub not_after { my $cert = shift; not_string2time($cert->get_notAfterString); } sub not_string2time { my $string = shift; # $string has the form 021019235959Z my($year, $month, $day, $hour, $minute, $second, $GMT)= $string=~m/(\d\d)(\d\d)(\d\d)(\d\d)(\d\d)(\d\d)(Z)?/; $year += 2000; my $time="$year-$month-$day $hour:$minute:$second"; $time .= " GMT" if $GMT; $time; } 1;