in reply to Help extracting public key from X509 .cer file

Crypt::X509

That's hit #2 if you search for X509 on search.cpan.org.

  • Comment on Re: Help extracting public key from X509 .cer file

Replies are listed 'Best First'.
Re^2: Help extracting public key from X509 .cer file
by boat73 (Scribe) on Aug 15, 2005 at 16:28 UTC
    Yes, I saw this, but the CPAN tests shows that it fails on win32 sysytems. The following code generated this error. asn decode error: decode error at C:/Perl/site/lib/Convert/ASN1/_decode.pm line 60. at C:\scripts\parsder.pl line 3 Can't use string ("1") as a HASH ref while "strict refs" in use at C:/Perl/site/lib/Crypt/X509.pm line 503.
    use Crypt::X509; $cer = "C:\\temp\\test.cer"; $cert = Crypt::X509->new( cert => $cer ); $subject_email = $cert->subject_email;
      Not a bad result for version 0.01 :)

      Did you try tracking down x509decode, which it's apparently based on? (Judging from a very quick reading of the README).

      Maybe you'll have more luck running Convert::ASN1; it includes the x509decode in the examples subdirectory.

      It may not work any better, but it's probably worth a try.


      Mike
        Perfect, thanks man. Now if only I could find a way to export it from the browser with perl I would be all set.