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 encryptedString)
Decrypts the inputString using the encryption password.static java.lang.String
decrypt(java.lang.String encryptedString, 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.ByteEncryptor
getByteEncryptor(java.lang.String encryptionPassword)
static org.jasypt.encryption.StringEncryptor
getDefaultEncryptor()
static java.lang.String
getPassword()
static org.jasypt.encryption.StringEncryptor
getStringEncryptor(java.lang.String encryptionPassword)
-
-
-
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 result of encryption
-
decrypt
public static java.lang.String decrypt(java.lang.String encryptedString)
Decrypts the inputString using the encryption password.- Parameters:
encryptedString
- the string to decrypt- Returns:
- the result of decryption
-
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 result of encryption
-
decrypt
public static java.lang.String decrypt(java.lang.String encryptedString, java.lang.String encryptionPassword)
Decrypts the inputString using the encryption password.- Parameters:
encryptedString
- the string to decryptencryptionPassword
- the password used for encryption- Returns:
- the result of decryption
-
getDefaultEncryptor
public static org.jasypt.encryption.StringEncryptor getDefaultEncryptor()
-
getStringEncryptor
public static org.jasypt.encryption.StringEncryptor getStringEncryptor(java.lang.String encryptionPassword)
-
getByteEncryptor
public static org.jasypt.encryption.ByteEncryptor getByteEncryptor(java.lang.String encryptionPassword)
-
-