mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-02 14:16:16 -04:00
Implement JSON API HTTP Basic authentication
jsonapi-generator is now capable of generating API for headers outside retroshare/ directory jsonapi-generator do a bit of methods parameter sanity check JsonApiServer is now integrated in the rsinit hell like other services Add *::exportGPGKeyPairToString to a bunch of classes in cascade RsControl is now capable of calling back a function when retroshare is almost completely stopped, this is useful when running retroshare toghether with externally managed runloop such as QCoreApplication Expose a bunch of methods through JSON API retroshare-nogui remove some dead code and fix stopping from the RetroShare API
This commit is contained in:
parent
ac9350d375
commit
eb77f921ec
32 changed files with 816 additions and 398 deletions
|
@ -709,6 +709,36 @@ bool PGPHandler::exportGPGKeyPair(const std::string& filename,const RsPgpId& exp
|
|||
return true ;
|
||||
}
|
||||
|
||||
bool PGPHandler::exportGPGKeyPairToString(
|
||||
std::string& data, const RsPgpId& exportedKeyId,
|
||||
bool includeSignatures, std::string& errorMsg ) const
|
||||
{
|
||||
RS_STACK_MUTEX(pgphandlerMtx);
|
||||
|
||||
const ops_keydata_t *pubkey = locked_getPublicKey(exportedKeyId,false);
|
||||
|
||||
if(!pubkey)
|
||||
{
|
||||
errorMsg = "Cannot output key " + exportedKeyId.toStdString() +
|
||||
": not found in public keyring.";
|
||||
return false;
|
||||
}
|
||||
const ops_keydata_t *seckey = locked_getSecretKey(exportedKeyId);
|
||||
|
||||
if(!seckey)
|
||||
{
|
||||
errorMsg = "Cannot output key " + exportedKeyId.toStdString() +
|
||||
": not found in secret keyring.";
|
||||
return false;
|
||||
}
|
||||
|
||||
data = makeRadixEncodedPGPKey(pubkey, includeSignatures);
|
||||
data += "\n";
|
||||
data += makeRadixEncodedPGPKey(seckey, includeSignatures);
|
||||
data += "\n";
|
||||
return true;
|
||||
}
|
||||
|
||||
bool PGPHandler::getGPGDetailsFromBinaryBlock(const unsigned char *mem_block,size_t mem_size,RsPgpId& key_id, std::string& name, std::list<RsPgpId>& signers) const
|
||||
{
|
||||
ops_keyring_t *tmp_keyring = allocateOPSKeyring();
|
||||
|
|
|
@ -99,6 +99,9 @@ class PGPHandler
|
|||
bool importGPGKeyPair(const std::string& filename,RsPgpId& imported_id,std::string& import_error) ;
|
||||
bool importGPGKeyPairFromString(const std::string& data,RsPgpId& imported_id,std::string& import_error) ;
|
||||
bool exportGPGKeyPair(const std::string& filename,const RsPgpId& exported_id) const ;
|
||||
bool exportGPGKeyPairToString(
|
||||
std::string& data, const RsPgpId& exportedKeyId,
|
||||
bool includeSignatures, std::string& errorMsg ) const;
|
||||
|
||||
bool availableGPGCertificatesWithPrivateKeys(std::list<RsPgpId>& ids);
|
||||
bool GeneratePGPCertificate(const std::string& name, const std::string& email, const std::string& passwd, RsPgpId& pgpId, const int keynumbits, std::string& errString) ;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue