Class EncryptedTranscoder

java.lang.Object
org.apereo.cas.web.flow.executor.EncryptedTranscoder
All Implemented Interfaces:
Transcoder

public class EncryptedTranscoder extends Object implements Transcoder
Encodes an object by encrypting its serialized byte stream. Details of encryption are handled by an instance of CipherBean.

Optional gzip compression of the serialized byte stream before encryption is supported and enabled by default.

Since:
6.1
  • Constructor Details

    • EncryptedTranscoder

      public EncryptedTranscoder(org.cryptacular.bean.CipherBean cipherBean)
    • EncryptedTranscoder

      public EncryptedTranscoder(org.cryptacular.bean.CipherBean cipherBean, boolean compression)
      Creates a new EncryptedTranscoder instance.
      Parameters:
      cipherBean - Handles encryption/decryption details.
      compression - Flag to indicate whether to Gzip compression before encryption.
  • Method Details

    • encode

      public byte[] encode(Object o) throws IOException
      Description copied from interface: Transcoder
      Encodes an object into a stream of bytes.
      Specified by:
      encode in interface Transcoder
      Parameters:
      o - Object to encode.
      Returns:
      Object encoded as a byte array.
      Throws:
      IOException - On encoding errors.
    • decode

      public Object decode(byte[] encoded) throws IOException
      Description copied from interface: Transcoder
      Decodes a stream of bytes produced by Transcoder.encode(Object) back into the original object.
      Specified by:
      decode in interface Transcoder
      Parameters:
      encoded - Encoded representation of an object.
      Returns:
      Object decoded from byte array.
      Throws:
      IOException - On decoding errors.