added a signature add/remove button in connect wizard, only when gpgme-1.3.1 or greater is used, based on the availability of the GPGME_EXPORT_MODE_MINIMAL option.

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@4372 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
csoler 2011-07-01 20:47:58 +00:00
parent 28e5f1b8f3
commit e9853b655c
7 changed files with 80 additions and 23 deletions

View file

@ -428,7 +428,7 @@ void AuthGPGimpl::processServices()
#endif
/* save the certificate to string */
loadOrSave->m_certGpg = SaveCertificateToString(loadOrSave->m_certGpgId);
loadOrSave->m_certGpg = SaveCertificateToString(loadOrSave->m_certGpgId,true);
}
service->setGPGOperation(loadOrSave);
@ -1353,7 +1353,7 @@ bool AuthGPGimpl::isGPGAccepted(const std::string &id)
/* SKTAN : do not know how to use std::string id */
std::string AuthGPGimpl::SaveCertificateToString(const std::string &id)
std::string AuthGPGimpl::SaveCertificateToString(const std::string &id,bool include_signatures)
{
if (!isGPGId(id)) {
@ -1368,13 +1368,19 @@ std::string AuthGPGimpl::SaveCertificateToString(const std::string &id)
pattern[0] = id.c_str();
gpgme_data_t gpgmeData;
#ifdef GPGME_EXPORT_MODE_MINIMAL
gpgme_export_mode_t export_mode = include_signatures?0:GPGME_EXPORT_MODE_MINIMAL ;
#else
gpgme_export_mode_t export_mode = 0 ;
#endif
if (GPG_ERR_NO_ERROR != gpgme_data_new (&gpgmeData))
{
std::cerr << "Error create Data" << std::endl;
}
gpgme_set_armor (CTX, 1);
if (GPG_ERR_NO_ERROR != gpgme_op_export_ext (CTX, pattern, 0, gpgmeData))
if (GPG_ERR_NO_ERROR != gpgme_op_export_ext (CTX, pattern, export_mode, gpgmeData))
{
std::cerr << "Error export Data" << std::endl;
}

View file

@ -213,7 +213,7 @@ virtual bool isGPGId(const std::string &id) = 0;
*
****/
virtual bool LoadCertificateFromString(const std::string &pem, std::string &gpg_id,std::string& error_string) = 0;
virtual std::string SaveCertificateToString(const std::string &id) = 0;
virtual std::string SaveCertificateToString(const std::string &id,bool include_signatures) = 0;
/*********************************************************************************/
/************************* STAGE 6 ***********************************************/
@ -333,7 +333,7 @@ virtual bool isGPGId(const std::string &id);
*
****/
virtual bool LoadCertificateFromString(const std::string &pem, std::string &gpg_id,std::string& error_string);
virtual std::string SaveCertificateToString(const std::string &id);
virtual std::string SaveCertificateToString(const std::string &id,bool include_signatures) ;
/*********************************************************************************/
/************************* STAGE 6 ***********************************************/