Class BytesEncryptor

java.lang.Object
com.axelor.common.crypto.BytesEncryptor
All Implemented Interfaces:
Encryptor<byte[],byte[]>

public class BytesEncryptor extends Object implements Encryptor<byte[],byte[]>
  • Constructor Details

  • Method Details

    • cbc

      public static BytesEncryptor cbc(String password)
    • gcm

      public static BytesEncryptor gcm(String password)
    • getTransformation

      public String getTransformation()
    • isEncrypted

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

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

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

      public String toString()
      Overrides:
      toString in class Object