Package com.aspectran.core.util
Class PBEncryptionUtils
- java.lang.Object
-
- com.aspectran.core.util.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
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
DEFAULT_ALGORITHM
static java.lang.String
ENCRYPTION_ALGORITHM_KEY
static java.lang.String
ENCRYPTION_PASSWORD_KEY
-
Constructor Summary
Constructors Constructor Description PBEncryptionUtils()
-
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()
-
-
-
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
-
-
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 encryptencryptionPassword
- 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 stringencryptionPassword
- 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)
-
-