diff --git a/libretroshare/src/pgp/pgphandler.cc b/libretroshare/src/pgp/pgphandler.cc index 45e9a4ad8..87bb462e0 100644 --- a/libretroshare/src/pgp/pgphandler.cc +++ b/libretroshare/src/pgp/pgphandler.cc @@ -1197,37 +1197,7 @@ bool PGPHandler::locked_addOrMergeKey(ops_keyring_t *keyring,std::maptype != OPS_PTAG_CT_PUBLIC_KEY) -// { -// std::cerr << "PGPHandler::encryptTextToFile(): ERROR: supplied id did not return a public key!" << std::endl; -// return false ; -// } -// -// ops_create_info_t *info; -// ops_memory_t *buf = NULL ; -// ops_setup_memory_write(&info, &buf, 0); -// -// ops_encrypt_stream(info, public_key, NULL, ops_false, ops_true); -// ops_write(text.c_str(), text.length(), info); -// ops_writer_close(info); -// -// outstring = std::string((char *)ops_memory_get_data(buf),ops_memory_get_length(buf)) ; -// ops_create_info_delete(info); -// -// return true ; -// } + bool PGPHandler::encryptTextToFile(const RsPgpId& key_id,const std::string& text,const std::string& outfile) { RsStackMutex mtx(pgphandlerMtx) ; // lock access to PGP memory structures. @@ -2129,4 +2099,3 @@ bool PGPHandler::removeKeysFromPGPKeyring(const std::set& keys_to_remov return true ; } - diff --git a/libretroshare/src/pgp/pgphandler.h b/libretroshare/src/pgp/pgphandler.h index 5137d5ba1..e0b563a64 100644 --- a/libretroshare/src/pgp/pgphandler.h +++ b/libretroshare/src/pgp/pgphandler.h @@ -21,10 +21,6 @@ *******************************************************************************/ #pragma once -#pragma once - -// This class implements an abstract pgp handler to be used in RetroShare. -// #include #include #include @@ -80,6 +76,7 @@ class PGPCertificateInfo static const uint8_t PGP_CERTIFICATE_TYPE_RSA = 0x02 ; }; +/// This class offer an abstract pgp handler to be used in RetroShare. class PGPHandler { public: @@ -125,8 +122,6 @@ class PGPHandler bool encryptTextToFile(const RsPgpId& key_id,const std::string& text,const std::string& outfile) ; bool decryptTextFromFile(const RsPgpId& key_id,std::string& text,const std::string& encrypted_inputfile) ; - //bool encryptTextToString(const RsPgpId& key_id,const std::string& text,std::string& outstring) ; - //bool decryptTextFromString(const RsPgpId& key_id,const std::string& encrypted_text,std::string& outstring) ; bool getKeyFingerprint(const RsPgpId& id,PGPFingerprintType& fp) const ; void setAcceptConnexion(const RsPgpId&,bool) ; @@ -232,4 +227,3 @@ class PGPHandler static PassphraseCallback _passphrase_callback ; static bool mergeKeySignatures(ops_keydata_t *dst,const ops_keydata_t *src) ; // returns true if signature lists are different }; -