Package com.saperion.util
Class ClientPasswordEncrypter
java.lang.Object
com.saperion.util.ClientPasswordEncrypter
Helper class that encrypts/decrypts password.
-
Method Summary
Modifier and TypeMethodDescriptionstatic StringDecrypts the given password.static StringEncrypts the given plaintext password.static booleanisEncrypted(String password) Returns whether the given password is encrypted or not.
-
Method Details
-
isEncrypted
Returns whether the given password is encrypted or not.- Parameters:
password- the password to check for encryption.- Returns:
- true, if encrypted, otherwise false.
-
encrypt
Encrypts the given plaintext password.- Parameters:
plaintextPassword- the password to encrypt.- Returns:
- the encrypted password.
-
decrypt
Decrypts the given password. A successful decryption can only be guaranteed ifisEncrypted(String)returns true for the given password.- Parameters:
encryptedPassword- the encrypted password to decrypt.- Returns:
- the decrypted password.
- Throws:
IllegalStateException- if the given password is not encrypted.
-