put previously global error handling and key hashes into ptx (pcp context) to make libpcp threadsafe.

This commit is contained in:
TLINDEN
2014-05-04 17:11:03 +02:00
parent d1c87d1001
commit da9891ff81
58 changed files with 1330 additions and 958 deletions

View File

@@ -30,6 +30,7 @@
#include "helpers++.h"
#include "buffer++.h"
#include "ptx++.h"
namespace pcp {
@@ -39,12 +40,14 @@ namespace pcp {
public:
pcp_pubkey_t *K;
PcpContext PTX;
// constructors
PubKey(PcpContext P);
PubKey();
PubKey(pcp_pubkey_t *k);
PubKey(pcp_pubkey_t *k, bool store);
PubKey(std::string &z85encoded);
PubKey(PcpContext P, pcp_pubkey_t *k);
PubKey(PcpContext P, pcp_pubkey_t *k, bool store);
PubKey(PcpContext P, std::string &z85encoded);
// destructors
~PubKey();
@@ -72,17 +75,19 @@ namespace pcp {
public:
// make access to the underlying struct easier
pcp_key_t *K;
PcpContext PTX;
// constructors
Key();
Key(bool generate);
Key(const std::string& passphrase);
Key(const std::string& passphrase,
Key(PcpContext P);
Key(PcpContext P, bool generate);
Key(PcpContext P, const std::string& passphrase);
Key(PcpContext P, const std::string& passphrase,
const std::string& owner,
const std::string& mail);
Key(pcp_key_t *k);
Key(pcp_key_t *k, bool store);
Key(std::string &z85encoded, std::string& passphrase);
Key(PcpContext P, pcp_key_t *k);
Key(PcpContext P, pcp_key_t *k, bool store);
Key(PcpContext P, std::string &z85encoded, std::string& passphrase);
// destructor
~Key();