org.owasp.esapi.crypto
Class CipherTextSerializer

java.lang.Object
  extended by org.owasp.esapi.crypto.CipherTextSerializer

public class CipherTextSerializer
extends java.lang.Object

Helper class to assist with programming language and platform independent serialization of CipherText objects. The serialization is done in network-byte order which is the same as big-endian byte order.

Author:
[email protected]

Constructor Summary
CipherTextSerializer(byte[] cipherTextSerializedBytes)
          Given byte array in network byte order (i.e., big-endian order), convert it so that a CipherText can be constructed from it.
CipherTextSerializer(CipherText cipherTextObj)
           
 
Method Summary
 CipherText asCipherText()
           
 byte[] asSerializedByteArray()
          Return this CipherText object as a specialized, portable serialized byte array.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CipherTextSerializer

public CipherTextSerializer(CipherText cipherTextObj)

CipherTextSerializer

public CipherTextSerializer(byte[] cipherTextSerializedBytes)
                     throws EncryptionException
Given byte array in network byte order (i.e., big-endian order), convert it so that a CipherText can be constructed from it.

Parameters:
cipherTextSerializedBytes - A serialized CipherText object with the bytes in network byte order.
Throws:
EncryptionException - Thrown if a valid CipherText object cannot be reconstructed from the byte array.
Method Detail

asSerializedByteArray

public byte[] asSerializedByteArray()
Return this CipherText object as a specialized, portable serialized byte array.

Returns:
A serialization of this object. Note that this is not the Java serialization.

asCipherText

public CipherText asCipherText()


Copyright © 2010 The Open Web Application Security Project (OWASP). All Rights Reserved.