jspωiki
Basic Encoding Rules

Overview#

Basic Encoding Rules (BER) are a set of ASN.1 x.690 encoding rules that define a specific way in which information may be encoded in a binary form. It is used as the underlying mechanism for encoding LDAP Message.

See http://blogs.sun.com/DirectoryManager/entry/a_quick_introduction_to_asn for a document that provides an introduction to BER encoding. Also see http://www.oss.com/asn1/larmouth.html for a PDF version of the "ASN.1 Complete" book by Professor John Larmouth, which is an excellent reference on ASN.1 and a number of its encoding rules, including BER.

BER and LDAP#

The following are the BER types in the universal class that you’re likely to encounter in LDAP:
Element TypeBinary EncodingHex Encoding
Boolean000000010x01
Integer000000100x02
Octet String000001000x04
Null000001010x05
Enumerated000010100x0a
Sequence001100000x30
Set001100010x31

ber_peek-tag#

ber_peek-tag is a collection of routines provide a subroutine interface to a simplified implementation of the Basic Encoding Rules of ASN.1. The version of BER these routines support is the one defined for the LDAP protocol. The encoding rules are the same as BER, except that only definite form lengths are used, and bitstrings and OctetStrings are always encoded in primitive form.

More Information#

There might be more information for this subject on one of the following: