Package net.i2p.router.web
Class ConsolePasswordManager
java.lang.Object
net.i2p.util.PasswordManager
net.i2p.router.util.RouterPasswordManager
net.i2p.router.web.ConsolePasswordManager
public class ConsolePasswordManager extends RouterPasswordManager
Manage both plaintext and salted/hashed password storage in
router.config.
- Since:
- 0.9.4
-
Field Summary
Fields inherited from class net.i2p.util.PasswordManager
PROP_B64, PROP_CRYPT, PROP_MD5, PROP_PW, PROP_SHASH, SALT_LENGTH, SHASH_LENGTH
-
Constructor Summary
Constructors Constructor Description ConsolePasswordManager(RouterContext ctx)
-
Method Summary
Modifier and Type Method Description boolean
checkMD5(String realm, String subrealm, String user, String pw)
Straight MD5.Map<String,String>
getMD5(String realm)
Get all MD5 usernames and passwords.boolean
saveMD5(String realm, String subrealm, String user, String pw)
Straight MD5, no salt Compatible with Jetty and RFC 2617.Methods inherited from class net.i2p.router.util.RouterPasswordManager
migrate, remove, save, saveB64, saveHash, savePlain
Methods inherited from class net.i2p.util.PasswordManager
check, checkB64, checkHash, checkHash, checkPlain, createHash, get, getB64, getPlain, md5Hex, md5Hex, md5Sum
-
Constructor Details
-
Method Details
-
checkMD5
Straight MD5. Compatible with Jetty.- Parameters:
realm
- e.g. i2cp, routerconsole, etc.user
- null or "" for no user, already trimmedpw
- plain text, already trimmed- Returns:
- if pw verified
-
getMD5
Get all MD5 usernames and passwords. Compatible with Jetty. Any "null" user is NOT included..- Parameters:
realm
- e.g. i2cp, routerconsole, etc.- Returns:
- Map of usernames to passwords (hex with leading zeros, 32 characters)
-
saveMD5
Straight MD5, no salt Compatible with Jetty and RFC 2617.- Parameters:
realm
- The full realm, e.g. routerconsole.auth.i2prouter, etc.subrealm
- to be used in creating the checksumuser
- non-null, non-empty, already trimmedpw
- plain text- Returns:
- if pw verified
-