Class ConsolePasswordManager


  • public class ConsolePasswordManager
    extends RouterPasswordManager
    Manage both plaintext and salted/hashed password storage in router.config.
    Since:
    0.9.4
    • Constructor Detail

      • ConsolePasswordManager

        public ConsolePasswordManager​(RouterContext ctx)
    • Method Detail

      • checkMD5

        public boolean checkMD5​(String realm,
                                String subrealm,
                                String user,
                                String pw)
        Straight MD5. Compatible with Jetty.
        Parameters:
        realm - e.g. i2cp, routerconsole, etc.
        user - null or "" for no user, already trimmed
        pw - plain text, already trimmed
        Returns:
        if pw verified
      • getMD5

        public Map<String,​String> getMD5​(String realm)
        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

        public boolean saveMD5​(String realm,
                               String subrealm,
                               String user,
                               String pw)
        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 checksum
        user - non-null, non-empty, already trimmed
        pw - plain text
        Returns:
        if pw verified