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 BytesEncryptor
cbc(String password)
byte[]
decrypt(byte[] bytes)
Decrypt the given encrypted message.byte[]
encrypt(byte[] bytes)
Encrypt the given message.static BytesEncryptor
gcm(String password)
String
getTransformation()
boolean
isEncrypted(byte[] bytes)
Check whether the given message is already encrypted or not.String
toString()
-
-
-
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:Encryptor
Check whether the given message is already encrypted or not.- Specified by:
isEncrypted
in interfaceEncryptor<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.
-
decrypt
public byte[] decrypt(byte[] bytes)
Description copied from interface:Encryptor
Decrypt the given encrypted message.
-
-