• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

iPlanet & LDAP

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i am using iPlanet web server and LDAP server i am able to get all attributes of OU in directory serevr, in my directory server i have added one attribute of an OU that is cacertificate and now i want to access the thumbprint of that certiicate, Can you please help me in getting the thubmprint of certificates stored in differend directories.
my code is as follow:
public static LinkedList search(String param[])
{


Hashtable env = new Hashtable();
String entries=null;
LinkedList entriesList=new LinkedList();
if((param[0]==null || param[0].length()==0))
entriesList.add("Host name not found....");

if((param[3]==null || param[3].length()==0))
entriesList.add("Search base not specified....");

if((param[4]==null || param[4].length()==0))
entriesList.add("Search criteria blank....");

if(entriesList.size()>0)
return entriesList;

env.put(Context.INITIAL_CONTEXT_FACTORY,"com.sun.jndi.ldap.LdapCtxFactory");
/* param[0]=URL of LDAP Serever e.i. ldap://host:389
*/
env.put(Context.PROVIDER_URL,param[0]);

try{
DirContext ctx=new InitialDirContext(env);
SearchControls constraints = new
SearchControls();
constraints.setSearchScope(SearchControls.SUBTREE_SCOPE);
/*
pram[3]=search base i.e. o=root and param[4]=Search condition i.e. objectClass=*
*/
NamingEnumeration results=ctx.search(param[3],param[4],constraints);
Attributes attr = null;
Enumeration enm=null;
while(results!=null && results.hasMore())
{
SearchResult sr = (SearchResult) results.next();
entries=sr.getName();
attr=sr.getAttributes();
enm=attr.getAll();
while(enm.hasMoreElements())
{
entries+=enm.nextElement()+", ";
}
entriesList.add(entries);
}
}catch(Exception e)
{
e.printStackTrace();
}
return entriesList;
}

Regards,
Alok
 
My first bit of advice is that if you are going to be a mime, you shouldn't talk. Even the tiny ad is nodding:
Clean our rivers and oceans from home
https://www.kickstarter.com/projects/paulwheaton/willow-feeders
reply
    Bookmark Topic Watch Topic
  • New Topic