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.
    void init​(ICryptingDelegateFactory factory)
    Initializes this instance.
    boolean isBlockBased()
    Returns true when the crypting algorithm is block based.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

  • 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 java.lang.Exception
      Encrypts the given bytes.
      Specified by:
      encrypt in interface ICryptingDelegate
      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.Exception
      Decrypts the given bytes.
      Specified by:
      decrypt in interface ICryptingDelegate
      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