Class PasswordUtils


  • public final class PasswordUtils
    extends Object
    Utilities for use with password creation.
    • Method Detail

      • generateSalt

        public static String generateSalt()
        Generates a salt for working with passwords.
        Returns:
        A salt
      • encrypt

        public static String encrypt​(String aText)
                              throws IOException
        Encrypts the supplied text.
        Parameters:
        aText - The text to be encrypted
        Returns:
        The encrypted password
        Throws:
        IOException - If there is trouble encrypting the supplied text
      • encrypt

        public static String encrypt​(String aText,
                                     String aSalt)
                              throws IOException
        Encrypts the supplied text using the supplied salt.
        Parameters:
        aText - The text to be encrypted
        aSalt - The salt to use in the encryption
        Returns:
        The encrypted password
        Throws:
        IOException - If there is trouble encrypting the supplied text