public class EncryptingSerializer extends StandardSerializer
| Constructor and Description |
|---|
EncryptingSerializer()
Default constructor
|
EncryptingSerializer(IElementSerializer serializer)
Wrapper constructor
|
| Modifier and Type | Method and Description |
|---|---|
<T> T |
deSerialize(byte[] data,
ClassLoader loader)
Uses default de-serialization to turn a byte array into an object.
|
<T> byte[] |
serialize(T obj)
Serializes an object using default serialization.
|
void |
setAesCipherTransformation(String transformation)
Set the cipher transformation for encryption and decryption
Default is AES/ECB/PKCS5Padding
|
void |
setPreSharedKey(String psk)
Set the pre-shared key for encryption and decryption
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitdeSerializeFrom, deSerializeFrom, deSerializeFrom, serializeTo, serializeTo, serializeTopublic EncryptingSerializer()
public EncryptingSerializer(IElementSerializer serializer)
serializer - the wrapped serializerpublic void setPreSharedKey(String psk)
psk - the keypublic void setAesCipherTransformation(String transformation)
transformation - the transformationpublic <T> byte[] serialize(T obj)
throws IOException
serialize in interface IElementSerializerserialize in class StandardSerializerT - the type of the objectobj - objectIOException - on i/o problempublic <T> T deSerialize(byte[] data,
ClassLoader loader)
throws IOException,
ClassNotFoundException
deSerialize in interface IElementSerializerdeSerialize in class StandardSerializerdata - data bytesloader - class loader to useIOException - on i/o problemClassNotFoundException - if class is not found during deserializationCopyright © 2002–2022 The Apache Software Foundation. All rights reserved.