directory-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Emmanuel Lecharny <elecha...@gmail.com>
Subject Re: Getting a clear text password from Apache DS 1.5.0
Date Thu, 13 Dec 2007 10:45:37 GMT
UdayaKiran Ala wrote:
> HI All,
>   
Hi,
>  Yes, I can retrieve a password if it is stored as clear text password.
> Below is the sample code snippet
>
>
> Attribute oPwdAttr = attrs.get(ATTR_PASSWORD);
>
> byte[] pwd = (byte[]) oPwdAttr.get();
>
> String sPwd = new String(pwd);
>   
just use this instead :
String sPwd = new String( pwd, "UTF-8" )

otherwise you may get some wrong password if you have not ascii chars 
into the password, depending on your locale.
> System.out.println("password is "+sPwd);
>
>
> Thanks
> Uday
>   


-- 
--
cordialement, regards,
Emmanuel L├ęcharny
www.iktek.com
directory.apache.org



Mime
View raw message