Package rs.baselib.crypto
Class DefaultCryptingDelegate
java.lang.Object
rs.baselib.crypto.DefaultCryptingDelegate
- All Implemented Interfaces:
ICryptingDelegate
public class DefaultCryptingDelegate extends java.lang.Object implements ICryptingDelegate
Implements basic crypting decrypting.
- Author:
- ralph
-
Constructor Summary
Constructors Constructor Description DefaultCryptingDelegate()Constructor. -
Method Summary
Modifier and Type Method Description byte[]decrypt(byte[] bytes)Decrypts the given bytes.byte[]encrypt(byte[] bytes)Encrypts the given bytes.voidinit(ICryptingDelegateFactory factory)Initializes this instance.booleanisBlockBased()Returns true when the crypting algorithm is block based.
-
Constructor Details
-
DefaultCryptingDelegate
public DefaultCryptingDelegate()Constructor.
-
-
Method Details
-
init
Initializes this instance.- Specified by:
initin interfaceICryptingDelegate- Parameters:
factory- the factory providing initialization parameters
-
encrypt
public byte[] encrypt(byte[] bytes) throws java.lang.ExceptionEncrypts the given bytes.- Specified by:
encryptin interfaceICryptingDelegate- Parameters:
bytes- bytes to be encrypted- Returns:
- encrypted bytes
- Throws:
java.lang.Exception- when an error occurs
-
decrypt
public byte[] decrypt(byte[] bytes) throws java.lang.ExceptionDecrypts the given bytes.- Specified by:
decryptin interfaceICryptingDelegate- Parameters:
bytes- bytes to be decrypted- Returns:
- decrypted bytes
- Throws:
java.lang.Exception- when an error occurs
-
isBlockBased
public boolean isBlockBased()Returns true when the crypting algorithm is block based.- Returns:
- true or false
-