added filtering of private key for login window, and fixed uid at cert creation time

git-svn-id: http://svn.code.sf.net/p/retroshare/code/branches/v0.5-OpenPGP@5282 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
csoler 2012-07-08 21:06:41 +00:00
parent fa6674fd01
commit 0a6c60d2df
6 changed files with 19 additions and 2 deletions

View file

@ -157,6 +157,7 @@ PGPHandler::PGPHandler(const std::string& pubring, const std::string& secring,co
std::cerr << "Secring read successfully." << std::endl;
locked_readPrivateTrustDatabase() ;
_trustdb_last_update_time = time(NULL) ;
}
void PGPHandler::initCertificateInfo(PGPCertificateInfo& cert,const ops_keydata_t *keydata,uint32_t index)
@ -285,6 +286,13 @@ bool PGPHandler::printKeys() const
return true ;
}
bool PGPHandler::haveSecretKey(const PGPIdType& id) const
{
RsStackMutex mtx(pgphandlerMtx) ; // lock access to PGP memory structures.
return getSecretKey(id) != NULL ;
}
const PGPCertificateInfo *PGPHandler::getCertificateInfo(const PGPIdType& id) const
{
RsStackMutex mtx(pgphandlerMtx) ; // lock access to PGP memory structures.
@ -330,7 +338,7 @@ bool PGPHandler::GeneratePGPCertificate(const std::string& name, const std::stri
// 1 - generate keypair - RSA-2048
//
ops_user_id_t uid ;
char *s = strdup((name + " " + email + " (Generated by RetroShare)").c_str()) ;
char *s = strdup((name + " (Generated by RetroShare) <" + email + ">" ).c_str()) ;
uid.user_id = (unsigned char *)s ;
unsigned long int e = 65537 ; // some prime number