mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-06-24 22:30:42 -04:00
Addition of several utility functions:
(1) xpgp_id to extract the name/id from a certificate. (2) dht_bootstrap to check the status of the bootstrap peers. Various bits of code needed to be rearranged to make these utilities possible. git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@394 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
e1f4dc1dff
commit
7044822e1f
12 changed files with 651 additions and 31 deletions
44
libretroshare/src/pqi/xpgp_id.cc
Normal file
44
libretroshare/src/pqi/xpgp_id.cc
Normal file
|
@ -0,0 +1,44 @@
|
|||
|
||||
|
||||
/***** Extract XPGP Id *****/
|
||||
|
||||
#include "pqi/authxpgp.h"
|
||||
|
||||
#include <iostream>
|
||||
#include <sstream>
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
if (argc < 2)
|
||||
{
|
||||
std::cerr << "Usage: " << argv[0] << " <certfile>";
|
||||
std::cerr << std::endl;
|
||||
exit(1);
|
||||
}
|
||||
|
||||
std::string userName, userId;
|
||||
|
||||
if (LoadCheckXPGPandGetName(argv[1], userName, userId))
|
||||
{
|
||||
std::cerr << "Cert Ok: name: " << userName;
|
||||
std::cerr << std::endl;
|
||||
std::cerr << "id = \"" << userId << "\"";
|
||||
std::cerr << std::endl;
|
||||
}
|
||||
else
|
||||
{
|
||||
std::cerr << "Cert Check Failed";
|
||||
std::cerr << std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue