Class StringEncryptor

java.lang.Object
com.axelor.common.crypto.StringEncryptor
All Implemented Interfaces:
Encryptor<String,String>

public class StringEncryptor extends Object implements Encryptor<String,String>
The StringEncryptor can be used to encrypt/decrypt String values.
  • Constructor Details

  • Method Details

    • cbc

      public static StringEncryptor cbc(String password)
    • gcm

      public static StringEncryptor gcm(String password)
    • isEncrypted

      public boolean isEncrypted(String message)
      Description copied from interface: Encryptor
      Check whether the given message is already encrypted or not.
      Specified by:
      isEncrypted in interface Encryptor<String,String>
      Parameters:
      message - the message to check
      Returns:
      true if encrypted
    • encrypt

      public String encrypt(String message)
      Description copied from interface: Encryptor
      Encrypt the given message.
      Specified by:
      encrypt in interface Encryptor<String,String>
      Parameters:
      message - the message to encrypt
      Returns:
      encrypted message
    • decrypt

      public String decrypt(String encryptedMessage)
      Description copied from interface: Encryptor
      Decrypt the given encrypted message.
      Specified by:
      decrypt in interface Encryptor<String,String>
      Parameters:
      encryptedMessage - the encrypted message to decrypt
      Returns:
      decrypted message
    • toString

      public String toString()
      Overrides:
      toString in class Object