Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic

Re: Re: Convert::ASN1

by Anonymous Monk
on Jul 22, 2003 at 14:15 UTC ( #276729=note: print w/replies, xml ) Need Help??

in reply to Re: Convert::ASN1
in thread Convert::ASN1

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. :-)

Replies are listed 'Best First'.
Re: Re: Convert::ASN1
by bibliophile (Parson) on Jul 22, 2003 at 19:35 UTC
    Oops, that was me (bibliophile) - I forgot to log in, sigh.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://276729]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (6)
As of 2018-07-16 22:48 GMT
Find Nodes?
    Voting Booth?
    It has been suggested to rename Perl 6 in order to boost its marketing potential. Which name would you prefer?

    Results (352 votes). Check out past polls.