Interface CipherHandler

All Known Implementing Classes:
DefaultCipherHandler

public interface CipherHandler
Encrypts and decrypts string values.
Since:
1.7
  • Method Summary

    Modifier and Type
    Method
    Description
    default byte[]
    decode(byte[] value)
    Decrypts the given value.
    decode(String value)
    Decrypts the given value.
    default byte[]
    encode(byte[] value)
    Encrypts the given value.
    encode(String value)
    Encrypts the given value.
  • Method Details

    • decode

      String decode(String value)
      Decrypts the given value.
    • decode

      default byte[] decode(byte[] value)
      Decrypts the given value. If not implemented explicitly, this creates a string from the byte array, decodes this with decode(String), and interprets this string as base 64 encoded byte array.

      if encode(byte[]) is overridden by an implementation, this has to be implemented accordingly.

      Parameters:
      value - encrypted value
      Returns:
      decrypted value
    • encode

      String encode(String value)
      Encrypts the given value.
    • encode

      default byte[] encode(byte[] value)
      Encrypts the given value. If not implemented explicitly, this encoded the given byte array as a base 64 string, encodes this string with encode(String), and returns the bytes of this resulting string.

      if decode(byte[]) is overridden by an implementation, this has to be implemented accordingly.

      Parameters:
      value - plain byte array to encrypt.
      Returns:
      encrypted value