securecomm.h
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef GM_SECURECOMM_H
00024 #define GM_SECURECOMM_H
00025
00026 namespace GNUMessenger {
00027
00033 class CryptoSession
00034 {
00035 public:
00036 CryptoSession();
00037 virtual ~CryptoSession();
00038 enum Status { None,Negotiation1,Reply1,Negoatiation2,Reply2,Connected};
00039
00040
00041
00042 string authenticate();
00043
00044
00045
00046
00047 void setPeer(const Certificate & peer) { this->peer = peer;};
00048 void setPrivkey(const string &key) { this->privKey = key; };
00049 void setCert(const Certificate& mycert) { this->mycert = mycert;};
00050
00051
00052 void parseAuthenticateReply(const string &msg);
00053
00054 string authenticate2();
00055
00056 void parseAuthenticate2Reply(const string &msg);
00057
00058 string authenticate3();
00059
00060 void parseAuthenticate3Reply(const string &msg);
00061
00062 enum {
00063 IDENTITY,
00064 SESSIONKEY,
00065 RANDOMDATA,
00066 RANDOMDATA2,
00067 SESSIONKEY2,
00068
00069 CERTIFICATE,
00070 MSG,
00071 SIGNATURE,
00072 };
00073
00074 byte random[16];
00075 byte random2[16];
00076
00077 string privKey;
00078 byte *sessionKey;
00079 int sessionKeyLen;
00080 byte *sessionKey2;
00081 int sessionKey2Len;
00082 byte *finalKey;
00083 int finalKeyLen;
00084 Status status;
00085 Certificate peer,mycert;
00086 };
00087
00088 }
00089
00090 #endif
Generated on Tue Oct 5 14:41:47 2004 for GNU Messenger by
1.3.8