Class PBEncryptionUtils


  • public class PBEncryptionUtils
    extends java.lang.Object
    This class provides basic encryption/decryption capabilities to implement PBE.

    Note: Note: Use StrongPasswordEncryptor for high-strength password digesting and checking.

    Created: 20/10/2018

    Since:
    5.3.3
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.String decrypt​(java.lang.String inputString)
      Decrypts the inputString using the encryption password.
      static java.lang.String decrypt​(java.lang.String inputString, java.lang.String encryptionPassword)
      Decrypts the inputString using the encryption password.
      static java.lang.String encrypt​(java.lang.String inputString)
      Encrypts the inputString using the encryption password.
      static java.lang.String encrypt​(java.lang.String inputString, java.lang.String encryptionPassword)
      Encrypts the inputString using the encryption password.
      static java.lang.String getAlgorithm()  
      static org.jasypt.encryption.pbe.PBEStringEncryptor getEncryptor()  
      static org.jasypt.encryption.pbe.PBEStringEncryptor getEncryptor​(java.lang.String encryptionPassword)  
      static java.lang.String getPassword()  
      • Methods inherited from class java.lang.Object

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

      • DEFAULT_ALGORITHM

        public static final java.lang.String DEFAULT_ALGORITHM
        See Also:
        Constant Field Values
      • ENCRYPTION_ALGORITHM_KEY

        public static final java.lang.String ENCRYPTION_ALGORITHM_KEY
        See Also:
        Constant Field Values
      • ENCRYPTION_PASSWORD_KEY

        public static final java.lang.String ENCRYPTION_PASSWORD_KEY
        See Also:
        Constant Field Values
    • Constructor Detail

      • PBEncryptionUtils

        public PBEncryptionUtils()
    • Method Detail

      • getAlgorithm

        public static java.lang.String getAlgorithm()
      • getPassword

        public static java.lang.String getPassword()
      • encrypt

        public static java.lang.String encrypt​(java.lang.String inputString)
        Encrypts the inputString using the encryption password.
        Parameters:
        inputString - the string to encrypt
        Returns:
        the encrypted string
      • encrypt

        public static java.lang.String encrypt​(java.lang.String inputString,
                                               java.lang.String encryptionPassword)
        Encrypts the inputString using the encryption password.
        Parameters:
        inputString - the string to encrypt
        encryptionPassword - the password to be used for encryption
        Returns:
        the encrypted string
      • decrypt

        public static java.lang.String decrypt​(java.lang.String inputString)
        Decrypts the inputString using the encryption password.
        Parameters:
        inputString - the key used to originally encrypt the string
        Returns:
        the decrypted version of inputString
      • decrypt

        public static java.lang.String decrypt​(java.lang.String inputString,
                                               java.lang.String encryptionPassword)
        Decrypts the inputString using the encryption password.
        Parameters:
        inputString - the key used to originally encrypt the string
        encryptionPassword - the password to be used for encryption
        Returns:
        the decrypted version of inputString
      • getEncryptor

        public static org.jasypt.encryption.pbe.PBEStringEncryptor getEncryptor()
      • getEncryptor

        public static org.jasypt.encryption.pbe.PBEStringEncryptor getEncryptor​(java.lang.String encryptionPassword)