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 10161 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 record
$_asn->registeroid("1",$asn_ext->find("APDU-Delivery-Info"));
####
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;
}
####
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;
}