00001 #ifndef __ENCAPSULATOR_H__ 00002 #define __ENCAPSULATOR_H__ 00003 00004 #include "RefCountBuffer.h" 00005 00006 class Msg; 00007 typedef unsigned short UINT16; 00008 00015 class Encapsulator { 00016 00017 public: 00027 Encapsulator(const ADDRESS &my_addr, const AGENT_VECTOR &agent_vector); 00028 00030 ~Encapsulator(); 00031 00044 RefCountBuffer Encrypt(MESSAGE Body,UINT32 DestinationIndx, ADDRESS &SendTo); 00045 00057 RefCountBuffer Decrypt(RefCountBuffer EncMsg,ADDRESS &SendTo,UINT32 &RetMsgId); 00058 00070 RefCountBuffer EncryptReply(MESSAGE Body,UINT32 ReplyMsgId,ADDRESS &SendTo); 00071 00073 void SetRouteLength(UINT32 rl); 00074 00076 std::string GetMyPublicKey(); 00077 00078 private: 00079 std::vector < Msg > MsgHistory; 00080 std::string MyPublicKey; 00081 std::string MyPrivateKey; 00082 00083 const AGENT_VECTOR &AppGroupList; 00084 ADDRESS MyAddress; 00085 UINT32 RouteLength; 00086 }; 00087 00088 #endif // __ENCAPSULATOR_H__