hypercast
Class EncryptedPayloadExtension

java.lang.Object
  |
  +--hypercast.Extension
        |
        +--hypercast.PayloadExtension
              |
              +--hypercast.EncryptedPayloadExtension

public class EncryptedPayloadExtension
extends PayloadExtension

This class extens class PayloadExtension and defines an encrypted payload extension. An instance of this class is constructed only when security policy is set to privacy.


Field Summary
 
Fields inherited from class hypercast.Extension
FSM, HEADER_NONE, RAW_DATA, ROUTE_RECORD, SECURITY
 
Constructor Summary
EncryptedPayloadExtension()
          Constructs an empty Extension
EncryptedPayloadExtension(byte[] payload, boolean isEncrypted, hypercast.KeyVault kv)
          Constructs an EncryptedPayloadExtension header object with all the parameters
EncryptedPayloadExtension(hypercast.EncryptedPayloadExtension e)
          Constructs an Extension from an existing one
 
Method Summary
 hypercast.Extension Clone()
          Return a new EncryptedPayloadExtension extension instance by cloning this extension.
 byte[] getPayload()
          Returns the payload byte array.
 int getSize()
          Returns the length of encrypted payload byte array in this extension.
 void setMessageKey(java.security.Key messagekey)
          Sets the message key which is used to do encryption/decryption of the payload.
 void setPayload(byte[] payload)
          Sets the plaintext payload in this extension to given byte array.
 byte[] toByteArray()
          Converts this object to byte array.
 
Methods inherited from class hypercast.PayloadExtension
getExtensionType
 
Methods inherited from class hypercast.Extension
createExtension, createExtension, createExtension, createExtension, createExtension, isValidHeader, toString, typeToString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

EncryptedPayloadExtension

public EncryptedPayloadExtension(byte[] payload,
                                 boolean isEncrypted,
                                 hypercast.KeyVault kv)
Constructs an EncryptedPayloadExtension header object with all the parameters

Parameters:
payload - payload byte array
isEncrypted - flag indicating the given payload is encrypted or plaintext payload. True if payload is encrypted, false otherwise.

EncryptedPayloadExtension

public EncryptedPayloadExtension(hypercast.EncryptedPayloadExtension e)
Constructs an Extension from an existing one


EncryptedPayloadExtension

public EncryptedPayloadExtension()
Constructs an empty Extension

Method Detail

Clone

public hypercast.Extension Clone()
Return a new EncryptedPayloadExtension extension instance by cloning this extension.

Overrides:
Clone in class PayloadExtension

setMessageKey

public void setMessageKey(java.security.Key messagekey)
Sets the message key which is used to do encryption/decryption of the payload.


toByteArray

public byte[] toByteArray()
Converts this object to byte array.

Overrides:
toByteArray in class PayloadExtension

getSize

public int getSize()
Returns the length of encrypted payload byte array in this extension.

Overrides:
getSize in class PayloadExtension

getPayload

public byte[] getPayload()
Returns the payload byte array.

Overrides:
getPayload in class PayloadExtension

setPayload

public void setPayload(byte[] payload)
Sets the plaintext payload in this extension to given byte array.

Overrides:
setPayload in class PayloadExtension