tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tim Funk <funk...@joedog.org>
Subject Re: Digest
Date Thu, 07 Aug 2003 10:42:07 GMT
My favorite Base64 library is org.apache.catalina.util.Base64 ;)

-Tim

Bill Barker wrote:
> I agree with Nikola. Firstly, even if you could access Catalina internals,
> you are calling the wrong method.  You would need to call getDigest(String
> userName, String Pass).  From the RealmBase code, you probably want
> something like:
> <%
>   MessageDigest md = MessageDigest.getInstance("MD5");
>   String preDigest = request.getParameter("user")+
> 
> ":"+RealmName+request.getParameter("password");
>   byte [] pwd = md.digest(preDigest.getBytes());
>   String digest = toBase64(pwd);
> %>
> 
> Here, toBase64 is your favorite byte->base64 encoding library.


Mime
View raw message