mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-08-12 00:00:44 -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();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue