From: Chris R. <chr...@me...> - 2000-08-01 08:15:35
|
Graham Barr <gb...@po...> wrote: > On Mon, Jul 31, 2000 at 04:24:44PM +0100, Chris Ridd wrote: >> I couldn't persuade Convert::ASN1 from messing with the time strings. >> Replacing 'UTCTime' above with '[UNIVERSAL 23] IMPLICIT STRING' will get >> the correct unadulterated times back... > > You mean you want the string exactly as it appeasrs ? Yes. It can sometimes be useful to get the 'raw' octets. (In this case, it was useful because I could compare the values with the strings I could see in the cert. But it's useful for when you care about what optional parts of the value are present.) > By default Convert::ASN1 will return a unix time (ie UTC) of the time in > the cert. > > If you do > > $asn->configure( decode => { timezone => 1 } ); > > Then the time value will be an array of two elements, the unixtime value > and the timezone offset that was specified. > > We could add other options to make it just return the string. > > Graham. That only gives me the following error: Can't use string ("decode") as a SCALAR ref while "strict refs" in use at /usr/lib/perl5/site_perl/5.005/Convert/ASN1.pm line 107. Convert::ASN1::configure('Convert::ASN1=HASH(0x8373cf0)', 'decode', 'HASH(0x83b2efc)') called at ./testcert.pl line 20 Cheers, Chris |