Date: | Thu, 29 Sep 2005 15:12:57 +1000 |
From: | George Michaelson <ggm [...] apnic.net> |
To: | bug-Convert-ASN1 [...] rt.cpan.org |
Subject: | minor nit: document ANY handling |
I've just spend a day working out how to use ANY to coerce unknown ASN1
pre-encoded strings into a parse tree!
I think the Manual/Pod should say:
MAPPING ASN.1 TO PERL
:
:
:
Finally, if you wish to pre-parse ASN.1 and hold it to include
inline in your PDU, you can coerce it into the ASN.1 spec by
defining the value as ANY in the schema, and then pass the pre
encoded value inline.
# ASN.1
int INTEGER,
str OCTET STRING,
pre ANY
# Perl
{ int => 5, str => "text", pre="\x03\x03\x00\x0a\x05" }
passes a pre-encoded BIT STRING instance as hex text. -But
it could be a previous run of $obj->encode() from another run
held in some variable.
-George
--
George Michaelson | APNIC
Email: ggm@apnic.net | PO Box 2131 Milton
Phone: +61 7 3858 3150 | QLD 4064 Australia
Fax: +61 7 3858 3199 | http://www.apnic.net