http://www.perlmonks.org?node_id=1056420

wpfontenot has asked for the wisdom of the Perl Monks concerning the following question:

Can anyone give me an idication of why this code is throwing the error below?
#!/usr/bin/perl # use Convert::ASN1; use Crypt::X509::CRL; use Data::Dumper; $crl = "./ent.crl"; $decoded = Crypt::X509::CRL->new( crl => $crl ); if ( $decoded->error ) { warn "Error on parsing Certificate Revocation List: ", $decoded->error; } print Dumper ($decoded);
This error
Error on parsing Certificate Revocation List: decode error at /usr/loc +al/share/perl5/Convert/ASN1/_decode.pm line 64. $VAR1 = bless( { '_error' => 'decode error at /usr/local/share/perl5/C +onvert/ASN1/_decode.pm line 64. ' }, 'Crypt::X509::CRL' );

Replies are listed 'Best First'.
Re: CRL parsing with Crypt::X509::CRL
by BrowserUk (Patriarch) on Sep 30, 2013 at 21:49 UTC

    You seem to be expecting decode to load the crl from a file. It doesn't.

    It is expecting you to pass it a string into which you have already loaded the crl.

    See http://cpansearch.perl.org/src/GIGAGEEK/Crypt-X509-CRL-0.1/t/Crypt-X509-CRL.t


    With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.
      Thank you very much, I figured it would be a case of not seeing the forest for the trees.