Class ClientPasswordEncrypter

java.lang.Object
com.saperion.util.ClientPasswordEncrypter

public class ClientPasswordEncrypter extends Object
Helper class that encrypts/decrypts password.
  • Method Details

    • isEncrypted

      public static boolean isEncrypted(String password)
      Returns whether the given password is encrypted or not.
      Parameters:
      password - the password to check for encryption.
      Returns:
      true, if encrypted, otherwise false.
    • encrypt

      public static String encrypt(String plaintextPassword)
      Encrypts the given plaintext password.
      Parameters:
      plaintextPassword - the password to encrypt.
      Returns:
      the encrypted password.
    • decrypt

      public static String decrypt(String encryptedPassword)
      Decrypts the given password. A successful decryption can only be guaranteed if isEncrypted(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.