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