ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/Convert-BER-XS/XS.pm
(Generate patch)

Comparing Convert-BER-XS/XS.pm (file contents):
Revision 1.11 by root, Fri Apr 19 20:44:34 2019 UTC vs.
Revision 1.12 by root, Fri Apr 19 21:24:31 2019 UTC

82data structures. It supports various mappings to JSON, XML, but most 82data structures. It supports various mappings to JSON, XML, but most
83importantly, to a various binary encodings such as BER, that is the topic 83importantly, to a various binary encodings such as BER, that is the topic
84of this module, and is used in SNMP or LDAP for example. 84of this module, and is used in SNMP or LDAP for example.
85 85
86While ASN.1 defines a schema that is useful to interpret encoded data, 86While ASN.1 defines a schema that is useful to interpret encoded data,
87the BER encoding is actually somehat self-describing: you might not know 87the BER encoding is actually somewhat self-describing: you might not know
88whether something is a string or a number or a sequence or something else, 88whether something is a string or a number or a sequence or something else,
89but you can nevertheless decode the overall structure, even if you end up 89but you can nevertheless decode the overall structure, even if you end up
90with just a binary blob for the actual value. 90with just a binary blob for the actual value.
91 91
92This works because BER values are tagged with a type and a namespace, 92This works because BER values are tagged with a type and a namespace,
249true. 249true.
250 250
251=item $bool = ber_is_oid $tuple, $oid_string 251=item $bool = ber_is_oid $tuple, $oid_string
252 252
253Returns true if the C<$tuple> represents an ASN_OBJECT_IDENTIFIER 253Returns true if the C<$tuple> represents an ASN_OBJECT_IDENTIFIER
254that exactly matches C$oid_string>. Exmaple: 254that exactly matches C<$oid_string>. Example:
255 255
256 ber_is_oid $tuple, "1.3.6.1.4" 256 ber_is_oid $tuple, "1.3.6.1.4"
257 or die "oid must be 1.3.6.1.4"; 257 or die "oid must be 1.3.6.1.4";
258 258
259=item $oid = ber_is_oid $tuple 259=item $oid = ber_is_oid $tuple

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines