mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-13 19:42:28 -04:00
JSON API import/export PGP key to file
This commit is contained in:
parent
7a1375ff6f
commit
6543d713e4
3 changed files with 27 additions and 7 deletions
|
@ -176,9 +176,26 @@ public:
|
|||
static int GetPGPLoginDetails(const RsPgpId& id, std::string &name, std::string &email);
|
||||
static bool GeneratePGPCertificate(const std::string&, const std::string& email, const std::string& passwd, RsPgpId &pgpId, const int keynumbits, std::string &errString);
|
||||
|
||||
// PGP Support Functions.
|
||||
static bool ExportIdentity(const std::string& fname,const RsPgpId& pgp_id) ;
|
||||
static bool ImportIdentity(const std::string& fname,RsPgpId& imported_pgp_id,std::string& import_error) ;
|
||||
/**
|
||||
* @brief Export full encrypted PGP identity to file
|
||||
* @jsonapi{development}
|
||||
* @param[in] filePath path of certificate file
|
||||
* @param[in] pgpId PGP id to export
|
||||
* @return true on success, false otherwise
|
||||
*/
|
||||
static bool ExportIdentity( const std::string& filePath,
|
||||
const RsPgpId& pgpId );
|
||||
|
||||
/**
|
||||
* @brief Import full encrypted PGP identity from file
|
||||
* @jsonapi{development,unauthenticated}
|
||||
* @param[in] filePath path of certificate file
|
||||
* @param[out] pgpId storage for the PGP fingerprint of the imported key
|
||||
* @param[out] errorMsg storage for eventual human readable error message
|
||||
* @return true on success, false otherwise
|
||||
*/
|
||||
static bool ImportIdentity(
|
||||
const std::string& filePath, RsPgpId& pgpId, std::string& errorMsg );
|
||||
|
||||
/**
|
||||
* @brief Import full encrypted PGP identity from string
|
||||
|
@ -188,7 +205,7 @@ public:
|
|||
* @param[out] errorMsg storage for eventual human readable error message
|
||||
* @return true on success, false otherwise
|
||||
*/
|
||||
static bool ImportIdentityFromString(
|
||||
static bool importIdentityFromString(
|
||||
const std::string& data, RsPgpId& pgpId,
|
||||
std::string& errorMsg );
|
||||
|
||||
|
|
|
@ -1347,9 +1347,12 @@ bool RsAccounts::ImportIdentity(const std::string& fname,RsPgpId& imported_pg
|
|||
return rsAccountsDetails->importIdentity(fname,imported_pgp_id,import_error);
|
||||
}
|
||||
|
||||
bool RsAccounts::ImportIdentityFromString(const std::string& data,RsPgpId& imported_pgp_id,std::string& import_error)
|
||||
bool RsAccounts::importIdentityFromString(
|
||||
const std::string& data, RsPgpId& imported_pgp_id,
|
||||
std::string& import_error )
|
||||
{
|
||||
return rsAccountsDetails->importIdentityFromString(data,imported_pgp_id,import_error);
|
||||
return rsAccountsDetails->
|
||||
importIdentityFromString(data, imported_pgp_id, import_error);
|
||||
}
|
||||
|
||||
/*static*/ bool RsAccounts::exportIdentityToString(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue