hypercast
Class SecurityExtension

java.lang.Object
  |
  +--hypercast.Extension
        |
        +--hypercast.SecurityExtension

public class SecurityExtension
extends Extension

This class defines the OL_Message extension with type SECURITY. In the byte array format of an overlay message, the security extension has the following format: (security policy is set to integrity) ------------------------------------------------------------------------------- |Next Header | Length | Sequence number | EP(Mk) / | 8 bits | 16 bits | 32 bits | 128 - 256 bits / ------------------------------------------------------------------------------- / SPI /Length of LA/ LA of sender / / 16 bits / 8 bits / variable / ------------------------------------------------------------------------------- / OL_H MAC Len / OL_H MAC /Payload MAC Len/ Payload MAC / / 8 bits / variable(>=128 bits) / 8 bits / variable(>=128 bits / ------------------------------------------------------------------------------- (security policy is set to privacy) ------------------------------------------------------------------------------- |Next Header | Length | Sequence number | EP(Mk) / | 8 bits | 16 bits | 32 bits | 128 - 256 bits / ------------------------------------------------------------------------------- / SPI /Length of LA/ LA of sender / / 16 bits / 8 bits / variable / ------------------------------------------------------------------------------- / OL_H MAC Len / OL_H MAC /Payload MAC Len/ Payload MAC / / 8 bits / variable(>=128 bits) / 8 bits / variable(>=128 bits / ------------------------------------------------------------------------------- This extension doesn't handle Next Header and Length fields, which are processed in OL_Message.


Field Summary
 
Fields inherited from class hypercast.Extension
FSM, HEADER_NONE, RAW_DATA, ROUTE_RECORD, SECURITY
 
Constructor Summary
SecurityExtension(byte[] contents, hypercast.KeyVault _kv)
          Constructor.
SecurityExtension(hypercast.KeyVault _kv, hypercast.I_LogicalAddress senderla)
          Constructor.
SecurityExtension(hypercast.SecurityExtension se)
          Constructs an SecurityExtension Extension from an existing one.
 
Method Summary
 hypercast.Extension Clone()
          Return a new SecurityExtension extension instance by cloning this extension.
 byte getExtensionType()
          Returns the type of extension.
 byte[] getHMac()
          Get hmac in this extension.
 javax.crypto.Mac getHMacCompute()
          Get hmac computation object in this extension.
 int getHMacLen()
          Get hmac length in this extension.
 int getHMacLoc()
          Get the location of hmac in packet.
 byte[] getMac()
          Get mac in this extension.
 java.security.Key getMsgKey()
          Get the message key in this extension.
 hypercast.I_LogicalAddress getSenderLA()
          Get the source logical address.
 int getSequenceNumber()
          Get the sequence number.
 int getSize()
          Returns the length of the byte array of this extension.
 void setSenderLA(hypercast.I_LogicalAddress senderla)
          Update the source logical address.
 void setSequenceNumber(int seqNum)
          Set the sequence number.
 byte[] toByteArray()
          Converts this object to byte array.
 void updateHMacCompute(byte[] contents)
          Update hmac computation object with a byte array.
 void updateMacCompute(byte[] contents)
          Update mac computation object with a byte array.
 
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

SecurityExtension

public SecurityExtension(hypercast.SecurityExtension se)
Constructs an SecurityExtension Extension from an existing one.


SecurityExtension

public SecurityExtension(hypercast.KeyVault _kv,
                         hypercast.I_LogicalAddress senderla)
Constructor.

Parameters:
_kv - key vault.
senderla - the logical address of message sender.

SecurityExtension

public SecurityExtension(byte[] contents,
                         hypercast.KeyVault _kv)
Constructor.

Method Detail

Clone

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

Specified by:
Clone in class Extension

getExtensionType

public byte getExtensionType()
Returns the type of extension.

Specified by:
getExtensionType in class Extension

toByteArray

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

Specified by:
toByteArray in class Extension

getSenderLA

public hypercast.I_LogicalAddress getSenderLA()
Get the source logical address.


setSenderLA

public void setSenderLA(hypercast.I_LogicalAddress senderla)
Update the source logical address.


getSequenceNumber

public int getSequenceNumber()
Get the sequence number.


setSequenceNumber

public void setSequenceNumber(int seqNum)
Set the sequence number.


updateHMacCompute

public void updateHMacCompute(byte[] contents)
Update hmac computation object with a byte array.


getHMacCompute

public javax.crypto.Mac getHMacCompute()
Get hmac computation object in this extension.


getHMac

public byte[] getHMac()
Get hmac in this extension.


getHMacLen

public int getHMacLen()
Get hmac length in this extension.


getHMacLoc

public int getHMacLoc()
Get the location of hmac in packet.


updateMacCompute

public void updateMacCompute(byte[] contents)
Update mac computation object with a byte array.


getMac

public byte[] getMac()
Get mac in this extension.


getMsgKey

public java.security.Key getMsgKey()
Get the message key in this extension.


getSize

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

Specified by:
getSize in class Extension