adding binary attribute using python-ldap

Michael Ströder michael at
Thu Mar 20 10:04:22 CET 2008

Rahul Amaram wrote:
> Thanks for the response. I think I found the reason for the error. It seems
> to be necessary to append ";binary" to the attribute name while
> adding/modifying binary attributes.

Not for all, better to say for just a few. Sending JPEG picture data for 
attribute type 'jpegPhoto' works straight with this attribute type name.

> So for instance if I am
> adding/modifying userCertificate, I will have to use the attribute name
> "userCertificate;binary". Else you are likely to get an undefined attribute
> / binary transfer failed error.

Yes, for most attribute types which hold certificate data. This has historic 
reasons because without ;binary another LDAP-specific encoding could be 
transferred. There has never been such a encoding defined. But you MUST use 
;binary for attributes with syntax 'X.509 Certificate' (syntax OID

See also section 2.1 of

Ciao, Michael.

More information about the python-ldap mailing list