Class DefaultCryptingDelegate

java.lang.Object
rs.baselib.crypto.DefaultCryptingDelegate
All Implemented Interfaces:
ICryptingDelegate

public class DefaultCryptingDelegate extends Object implements ICryptingDelegate
Implements basic crypting decrypting.
Author:
ralph
  • Constructor Details

    • DefaultCryptingDelegate

      public DefaultCryptingDelegate()
      Constructor.
  • Method Details

    • init

      public void init(ICryptingDelegateFactory factory)
      Initializes this instance.
      Specified by:
      init in interface ICryptingDelegate
      Parameters:
      factory - the factory providing initialization parameters
    • encrypt

      public byte[] encrypt(byte[] bytes) throws Exception
      Encrypts the given bytes.
      Specified by:
      encrypt in interface ICryptingDelegate
      Parameters:
      bytes - bytes to be encrypted
      Returns:
      encrypted bytes
      Throws:
      Exception - when an error occurs
    • decrypt

      public byte[] decrypt(byte[] bytes) throws Exception
      Decrypts the given bytes.
      Specified by:
      decrypt in interface ICryptingDelegate
      Parameters:
      bytes - bytes to be decrypted
      Returns:
      decrypted bytes
      Throws:
      Exception - when an error occurs
    • isBlockBased

      public boolean isBlockBased()
      Returns true when the crypting algorithm is block based.
      Returns:
      true or false