controls and BER encoding of its values

Michael Ströder michael at stroeder.com
Mon May 28 20:07:09 CEST 2007


Andreas Hasenack wrote:
> 
> last Friday I played a bit with controls in python-ldap. I was trying to
> get the matched-values control (LDAP_CONTROL_VALUESRETURNFILTER) to
> work.

Feel free to contribute your results.

> It seems I have to manually do the BER encoding of the values. I googled
> for some modules and pyasn1 seems to be the most complete one, but I
> would have to basically write classes for the whole LDAP spec :(

You can use pyasn1 for just creating the BER en-/decoding the control
values. Please look into Lib/ldap/controls.py to get the idea how you
can implement the methods for encoding and decoding in sub-classes of
ldap.controls.LDAPControl.

> This mailing list had some discussion about this previously, and some
> other names popped up, like pysnmp and pisces.

pisces is pretty much dead although I'm still using it in web2ldap for
certificate decoding. pyasn1 was extracted from pysnmp - same author.

Ciao, Michael.



More information about the python-ldap mailing list