[Date Prev][Date Next] [Chronological] [Thread] [Top]

Retrieve binary value with php from LDAP



hi

I am a new babies in LDAP certificate. I know in my
LDAP directory, It story the certificate in DER
format. 

I am trying to your for function to read then
certificate in LDAP directory. 

function certfiles ($dn) {
$ldapcall = "ldapsearch -x -LLL -h localhost -p 1717
-s base -b \"" . $dn . "\" -t usercertificate ";
  $res = `$ldapcall`;
  $res_ar = explode("\n", $res);
  $dn_garbage = array_shift ($res_ar);   // do not use
1st line (dn)
  return $res_ar;
}

When I try, it return nothing. How do i know the
command line $ldapcall is execute? 

Also, I use this command line to run in the system
It return 

#
# filter: objectclass=*
# requesting: userCertificate
#

# smith, coolwater, ca
dn: cn=smith,o=xxx,c=ca

# search result
search: 2
result: 0 Success

# numResponses: 2
# numEntries: 1

I am sure the usercertificate is exist in the
directory.
If i am not specifiy the display attribute, It show
the certificate value in mine code. 

could anyone help me how to do in php to make it work?

Thanks

Florence

__________________________________________________
Do You Yahoo!?
Yahoo! Tax Center - online filing with TurboTax
http://taxes.yahoo.com/