Package org.apereo.cas.web.flow.executor
Class EncryptedTranscoder
- java.lang.Object
-
- org.apereo.cas.web.flow.executor.EncryptedTranscoder
-
- All Implemented Interfaces:
Transcoder
public class EncryptedTranscoder extends java.lang.Object implements Transcoder
Encodes an object by encrypting its serialized byte stream. Details of encryption are handled by an instance ofCipherBean.Optional gzip compression of the serialized byte stream before encryption is supported and enabled by default.
- Since:
- 6.1
-
-
Constructor Summary
Constructors Constructor Description EncryptedTranscoder(org.cryptacular.bean.CipherBean cipherBean)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Objectdecode(byte[] encoded)Decodes a stream of bytes produced byTranscoder.encode(Object)back into the original object.byte[]encode(java.lang.Object o)Encodes an object into a stream of bytes.protected byte[]encrypt(java.io.ByteArrayOutputStream outBuffer)Encrypt.protected voidwriteObjectToOutputStream(java.lang.Object o, java.io.ObjectOutputStream out)Write object to output stream.
-
-
-
Method Detail
-
encode
public byte[] encode(java.lang.Object o) throws java.io.IOExceptionDescription copied from interface:TranscoderEncodes an object into a stream of bytes.- Specified by:
encodein interfaceTranscoder- Parameters:
o- Object to encode.- Returns:
- Object encoded as a byte array.
- Throws:
java.io.IOException- On encoding errors.
-
writeObjectToOutputStream
protected void writeObjectToOutputStream(java.lang.Object o, java.io.ObjectOutputStream out) throws java.io.IOExceptionWrite object to output stream.- Parameters:
o- the oout- the out- Throws:
java.io.IOException- the io exception
-
encrypt
protected byte[] encrypt(java.io.ByteArrayOutputStream outBuffer) throws java.io.IOExceptionEncrypt.- Parameters:
outBuffer- the out buffer- Returns:
- the byte [ ]
- Throws:
java.io.IOException- the io exception
-
decode
public java.lang.Object decode(byte[] encoded) throws java.io.IOExceptionDescription copied from interface:TranscoderDecodes a stream of bytes produced byTranscoder.encode(Object)back into the original object.- Specified by:
decodein interfaceTranscoder- Parameters:
encoded- Encoded representation of an object.- Returns:
- Object decoded from byte array.
- Throws:
java.io.IOException- On decoding errors.
-
-