Class PasswordMapper


  • public class PasswordMapper
    extends java.lang.Object
    This object manages a session-based map of password keys.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String _rcsid  
      protected static char[] pickChars  
    • Constructor Summary

      Constructors 
      Constructor Description
      PasswordMapper()
      Constructor
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected static java.lang.String generateRandomPrefix()
      Generate a random prefix that will not likely collide with any password
      java.lang.String mapKeyToPassword​(java.lang.String key)
      Map a key back to a password.
      java.lang.String mapPasswordToKey​(java.lang.String password)
      Map a password to a key.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • pickChars

        protected static char[] pickChars
    • Constructor Detail

      • PasswordMapper

        public PasswordMapper()
        Constructor
    • Method Detail

      • mapPasswordToKey

        public java.lang.String mapPasswordToKey​(java.lang.String password)
        Map a password to a key.
        Parameters:
        password - is the password.
        Returns:
        the key.
      • mapKeyToPassword

        public java.lang.String mapKeyToPassword​(java.lang.String key)
        Map a key back to a password.
        Parameters:
        key - is the key (or a password, if changed)
        Returns:
        the password.
      • generateRandomPrefix

        protected static java.lang.String generateRandomPrefix()
        Generate a random prefix that will not likely collide with any password