removed duplicate function p3peers::CertToFile().

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@619 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
drbob 2008-06-20 13:16:39 +00:00
parent 2059e102bf
commit d8def217fa
3 changed files with 0 additions and 36 deletions

View File

@ -153,12 +153,6 @@ virtual bool AuthCertificate(std::string id, std::string code) = 0;
virtual bool SignCertificate(std::string id) = 0;
virtual bool TrustCertificate(std::string id, bool trust) = 0;
/**
* saves the usrs cert to file so it can easily be attached in an email
* @return successful or not
*/
virtual bool certToFile(void) = 0;
};
#endif

View File

@ -791,32 +791,3 @@ uint32_t RsPeerTranslateTrust(uint32_t trustLvl)
return RS_TRUST_LVL_UNKNOWN;
}
bool p3Peers::certToFile(void)
{
std::string invite = GetRetroshareInvite();
const int SIZE = 400;
char certStore[SIZE]; // enough store to reach certification part of string
std::ofstream cert_file; // to help with counting non cert part of string
std::istringstream certFind(invite); // tie invite to stream
/* find out how long it takes to reach certification part of string */
certFind.get(certStore, SIZE, '=');
invite.erase(0, certFind.gcount()); // delete all characters before certificate part
#ifdef P3PEERS_DEBUG
std::cerr << "p3Peers::certToFile() : certificate" << invite;
#endif
std::string usrId = getPeerName(getOwnId()); // replace with actual textual id
usrId += ".pqi";
cert_file.open(usrId.c_str());
cert_file << invite; //store cert to file
cert_file.close();
return true;
}

View File

@ -75,7 +75,6 @@ virtual std::string SaveCertificateToString(std::string id);
virtual bool AuthCertificate(std::string id, std::string code);
virtual bool SignCertificate(std::string id);
virtual bool TrustCertificate(std::string id, bool trust);
virtual bool certToFile(void);
private: