Package com.axelor.common.crypto
Class BytesEncryptor
- java.lang.Object
-
- com.axelor.common.crypto.BytesEncryptor
-
-
Constructor Summary
Constructors Constructor Description BytesEncryptor(OperationMode mode, PaddingScheme paddingScheme, String password)BytesEncryptor(String password)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static BytesEncryptorcbc(String password)byte[]decrypt(byte[] bytes)Decrypt the given encrypted message.byte[]encrypt(byte[] bytes)Encrypt the given message.static BytesEncryptorgcm(String password)StringgetTransformation()booleanisEncrypted(byte[] bytes)Check whether the given message is already encrypted or not.StringtoString()
-
-
-
Constructor Detail
-
BytesEncryptor
public BytesEncryptor(OperationMode mode, PaddingScheme paddingScheme, String password)
-
BytesEncryptor
public BytesEncryptor(String password)
-
-
Method Detail
-
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:EncryptorCheck whether the given message is already encrypted or not.- Specified by:
isEncryptedin interfaceEncryptor<byte[],byte[]>- Parameters:
bytes- the message to check- Returns:
- true if encrypted
-
encrypt
public byte[] encrypt(byte[] bytes)
Description copied from interface:EncryptorEncrypt the given message.
-
decrypt
public byte[] decrypt(byte[] bytes)
Description copied from interface:EncryptorDecrypt the given encrypted message.
-
-