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.

- - ### Field Summary

    - ### Fields inherited from class net.i2p.router.util.RouterPasswordManager

      `_context`

    - ### 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 and Description
    `ConsolePasswordManager(RouterContext ctx)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and 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, sha256Hex, sha256Hex`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### 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