Class PasswordMaskingUtil


  • public final class PasswordMaskingUtil
    extends java.lang.Object
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String BEGIN_ENC  
      static java.lang.String END_ENC  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static SensitiveDataCodec<java.lang.String> getCodec​(java.lang.String codecDesc)  
      static DefaultSensitiveStringCodec getDefaultCodec()  
      static HashProcessor getHashProcessor()  
      static HashProcessor getHashProcessor​(java.lang.String storedPassword)  
      static boolean isEncMasked​(java.lang.String password)  
      static java.lang.String resolveMask​(java.lang.Boolean maskPassword, java.lang.String password, java.lang.String codecClass)
      This method deals with password masking and returns the password in its plain text form.
      static java.lang.String resolveMask​(java.lang.String password, java.lang.String codecClass)
      This method deals with password masking and returns the password in its plain text form.
      static java.lang.String unwrap​(java.lang.String password)  
      static java.lang.String wrap​(java.lang.String password)  
      • Methods inherited from class java.lang.Object

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

      • resolveMask

        public static java.lang.String resolveMask​(java.lang.String password,
                                                   java.lang.String codecClass)
                                            throws java.lang.Exception
        This method deals with password masking and returns the password in its plain text form.
        Parameters:
        password - : the original value of password string; interpreted as masked if wrapped in ENC() or as plain text otherwise.
        codecClass - : the codec used to decode the password. Only when the password is interpreted as masked will this codec be used. Ignored otherwise.
        Returns:
        Throws:
        java.lang.Exception
      • resolveMask

        public static java.lang.String resolveMask​(java.lang.Boolean maskPassword,
                                                   java.lang.String password,
                                                   java.lang.String codecClass)
                                            throws java.lang.Exception
        This method deals with password masking and returns the password in its plain text form.
        Parameters:
        maskPassword - : explicit mask flag. If it's true, the password is interpreted as masked. If it is false, the password is interpreted as plain text. if it is null, the password will be interpreted as masked if the password is wrapped in ENC(), or as plain text otherwise.
        password - : the original value of password string
        codecClass - : the codec used to decode the password. Only when the password is interpreted as masked will this codec be used. Ignored otherwise.
        Returns:
        Throws:
        java.lang.Exception
      • isEncMasked

        public static boolean isEncMasked​(java.lang.String password)
      • unwrap

        public static java.lang.String unwrap​(java.lang.String password)
      • wrap

        public static java.lang.String wrap​(java.lang.String password)
      • getHashProcessor

        public static HashProcessor getHashProcessor​(java.lang.String storedPassword)
      • getHashProcessor

        public static HashProcessor getHashProcessor()