tomcat-users mailing list archives

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

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
https://tomcat.apache.org/tomcat-9.0-doc/realm-howto.html#Digested_Passwords I
see that it says:

<quote>
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.
</quote>

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,
  Pawel.

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