Hi Waswas,

Here's a bit from my init routine (the ::desc package variables contain the ASN.1 descriptions; the _asn variables are class data (so I don't have to re-prepare the ASN.1 descriptions over and over) - I can send the whole module if you'd like):

my $asn_ext = Convert::ASN1->new; $asn_ext->prepare( $Biblio::ILL::ISO::1_0_10161_13_3::desc ); # some error checking here, snipped for brevity $_asn = Convert::ASN1->new; $_asn->prepare( $Biblio::ILL::ISO::asn::desc ); # some error checking here, snipped for brevity $_asn_initialized = 1; # "1.0.10161.13.3" is what it *should* be, according to the ISO 10 +161 maintenance agency: #$_asn->registeroid("1.0.10161.13.3",$asn_ext->find("APDU-Delivery +-Info")); # "1" is what it *is*, by looking at a hex dump of the request rec +ord $_asn->registeroid("1",$asn_ext->find("APDU-Delivery-Info"));

The encode routine:

sub encode { my $self = shift; my $href = $self->as_asn(); # builds a Convert::ASN1-parsable hash my $asn = $_asn->find( 'ILL-Request' ) or warn $_asn->error; my $pdu = $asn->encode( $href ) or warn $asn->error; return $pdu; }

And the decode routine:

sub decode { my $self = shift; my $pdu = shift; my $asn = $_asn->find( 'ILL-Request' ) or warn $_asn->error; my $href = $asn->decode( $pdu ) or warn $asn->error; return $href; }

I *think* the question is: How do I, in the middle of an 'ILL-Request' decode, tell it to find('APDU-Delivery-Info') when/if it encounters that extension code?

Of course, I could be completely misunderstanding the way that Convert::ASN1 works. :-)


In reply to Re: Re: Convert::ASN1 by Anonymous Monk
in thread Convert::ASN1 by bibliophile

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.