mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-12-25 07:29:33 -05:00
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:
parent
2059e102bf
commit
d8def217fa
@ -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
|
||||
|
@ -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;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -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:
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user