Main Page   Class Hierarchy   Data Structures   File List   Data Fields  

Encapsulator Class Reference

#include <Encapsulator.h>


Public Member Functions

 Encapsulator (const ADDRESS &my_addr, const AGENT_VECTOR &agent_vector)
 Encapsulator constructor.

 ~Encapsulator ()
 Encapsulator destructor.

RefCountBuffer Encrypt (MESSAGE Body, UINT32 DestinationIndx, ADDRESS &SendTo)
 Message encryption function.

RefCountBuffer Decrypt (RefCountBuffer EncMsg, ADDRESS &SendTo, UINT32 &RetMsgId)
 Message decryption function.

RefCountBuffer EncryptReply (MESSAGE Body, UINT32 ReplyMsgId, ADDRESS &SendTo)
 Reply encryption function.

void SetRouteLength (UINT32 rl)
 Set the encapsulated route length.

std::string GetMyPublicKey ()
 Get the encryption public key.


Private Attributes

std::vector< Msg > MsgHistory
std::string MyPublicKey
std::string MyPrivateKey
const AGENT_VECTOR & AppGroupList
ADDRESS MyAddress
UINT32 RouteLength


Detailed Description

This class is used for encrypting and decrypting messages using a public key cryptography and Amnon Ta-Shma, Ron Berman & Amos Fiat algorithm.


Constructor & Destructor Documentation

Encapsulator::Encapsulator const ADDRESS   my_addr,
const AGENT_VECTOR &    agent_vector
 

Encapsulator constructor.

Parameters:
<my_addr> This parameter will initialize the encapsulator with our address
<agent_vector> This parameter is for setting the agent vector pointer
The constructor will initialize all encryption keys. This operation might take a while if the key is long.


Member Function Documentation

RefCountBuffer Encapsulator::Decrypt RefCountBuffer    EncMsg,
ADDRESS   SendTo,
UINT32 &    RetMsgId
 

Message decryption function.

Parameters:
<EncMsg> Encrypted message to be decrypted
<SendTo> This will be filled with the address to forward the message to if its not for us.
<RetMsgId> A unique message ID for replying the message
Returns:
A Decrypted or decapsulated message buffer.
This function will open the buffer recieved by the agent, and decide weather this is a message for us, a reply or just some message we need to forward.

RefCountBuffer Encapsulator::Encrypt MESSAGE    Body,
UINT32    DestinationIndx,
ADDRESS   SendTo
 

Message encryption function.

Parameters:
<Body> The message text.
<DestinationIndx> Destination in agents vector to send the message to.
<SendTo> Return address of where to send the encapsulated message.
Returns:
An encrypted buffer encapsulated with the route selected.
This function will choose a random path between agents to the requested one. The message then will be encapsulated by the vertex public keys with the addresses and packed into the return buffer.

RefCountBuffer Encapsulator::EncryptReply MESSAGE    Body,
UINT32    ReplyMsgId,
ADDRESS   SendTo
 

Reply encryption function.

Parameters:
<Body> Message to be encrypted as a reply
<ReplyMsgId> The message ID we recieved the message with
<SendTo> The address we need to send the returned buffer to
Returns:
An encrypted reply buffer
This function will encrypt the reply message using the unique keys and return a buffer ready to be sent back in the route recieved.


The documentation for this class was generated from the following file:
Generated on Sun Mar 2 01:48:12 2003 for Agent by doxygen1.3-rc3