tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Pawel Veselov <>
Subject Generating passwords digests for 9.0.27
Date Tue, 05 Nov 2019 00:52:44 GMT

I'm doing something where I need to generate a password for a tomcat user
that is authenticated using org.apache.catalina.realm.UserDatabaseRealm
with "sha" digest, the user database is
produced by org.apache.catalina.users.MemoryUserDatabaseFactory from an xml
file (standard conf/tomcat-users.xml)

Reading I
see that it says:

If you are writing an application that needs to calculate digested
passwords dynamically, call the static Digest() method of the
org.apache.catalina.realm.RealmBase class, passing the cleartext password,
the digest algorithm name and the encoding as arguments. This method will
return the digested password.

However, there is no static method Digest
in org.apache.catalina.realm.RealmBase.

What is the proper way to programmatically generate a proper password hash?

Thank you,

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message