148 #include <irrxml/irrXML.hpp>
161 const char* szFuncName)
164 (
nullptr != szFuncName) ? szFuncName :
"OTPseudonym::LoadPublicNym";
173 : (
new OTPseudonym(*pstrName, strNymID, strNymID));
175 "OTPseudonym::LoadPublicNym: Error allocating memory.\n");
186 otWarn << __FUNCTION__ <<
": " << szFunc
187 <<
": Unable to find nym: " << strNymID <<
"\n";
189 otErr << __FUNCTION__ <<
": " << szFunc
190 <<
": Security: Failure verifying Nym: " << strNymID <<
"\n";
192 otLog4 <<
"OTPseudonym::LoadPublicNym " << szFunc
193 <<
": Usually normal: There's no Nymfile (" << strNymID
194 <<
"), though there IS a public "
195 "key, which checks out. It's probably just someone else's "
196 "Nym. (So I'm still returning this Nym to "
197 "the caller so he can still use the public key.)\n";
289 const char* szFuncName,
294 (
nullptr != szFuncName) ? szFuncName :
"OTPseudonym::LoadPrivateNym";
296 if (NYM_ID.
IsEmpty())
return nullptr;
305 : (
new OTPseudonym(*pstrName, strNymID, strNymID));
307 "OTPseudonym::LoadPrivateNym: Error allocating memory.\n");
310 if (
nullptr == pPWData) pPWData = &thePWData;
324 "%s: %s: (%s: is %s). Unable to load credentials, "
325 "cert and private key for: %s (maybe this nym doesn't exist?)\n",
326 __FUNCTION__, szFunc,
"bChecking", bChecking ?
"true" :
"false",
331 otErr << __FUNCTION__ <<
" " << szFunc
332 <<
": Failure verifying Nym public key: " << strNymID <<
"\n";
339 otErr << __FUNCTION__ <<
" " << szFunc
340 <<
": Failure calling LoadSignedNymfile: " << strNymID <<
"\n";
429 const OTString* pstrSourceToUse =
nullptr;
459 if (
nullptr == pmapPrivate)
465 const size_t sizeMapPublic = mapPublic.size();
466 const size_t sizeMapPrivate = mapPrivate.size();
468 OTString strReason, strPublicError, strPrivateError;
498 if ((m_mapCredentials.empty() ||
505 strReason.
Set(
"Using existing signing key for new master "
506 "credential (preserving existing Nym keypair.)");
507 strPublicError.
Set(
"In %s, line %d: Failed using existing public "
508 "key as public signing key in "
509 "OTPseudonym::%s.\n");
510 strPrivateError.
Set(
"In %s, line %d: Failed using existing private "
511 "key as private signing key in "
512 "OTPseudonym::%s.\n");
528 strReason.
Set(
"Generating signing key for new master credential.");
529 strPublicError.
Set(
"In %s, line %d: Failed creating public signing "
530 "key in OTPseudonym::%s.\n");
531 strPrivateError.
Set(
"In %s, line %d: Failed creating private "
532 "signing key in OTPseudonym::%s.\n");
537 OTString strPublicKey, strPrivateCert;
540 strPublicKey,
false);
542 strPrivateCert, &strReason);
546 std::pair<std::string, std::string>(
"S", strPublicKey.
Get()));
548 std::pair<std::string, std::string>(
"S", strPrivateCert.
Get()));
551 if (!b1 || !(mapPublic.size() > sizeMapPublic)) {
557 if (!b2 || !(mapPrivate.size() > sizeMapPrivate)) {
582 OT_ASSERT(bCreateKeyAuth && bCreateKeyEncr);
595 strPublicKey,
false);
601 std::pair<std::string, std::string>(
"A", strPublicKey.
Get()));
603 std::pair<std::string, std::string>(
"A", strPrivateCert.
Get()));
610 strPublicKey,
false);
616 std::pair<std::string, std::string>(
"E", strPublicKey.
Get()));
618 std::pair<std::string, std::string>(
"E", strPrivateCert.
Get()));
621 if (!(mapPublic.size() >= (sizeMapPublic + 3))) {
623 <<
"In " << __FILE__ <<
", line " << __LINE__
624 <<
": Failed adding (auth or encr) public keys in OTPseudonym::"
625 << __FUNCTION__ <<
".\n";
629 if (!(mapPrivate.size() >= (sizeMapPrivate + 3))) {
630 otErr <<
"In " << __FILE__ <<
", line " << __LINE__
631 <<
": Failed adding (auth or encr) private keys in "
632 "OTPseudonym::" << __FUNCTION__ <<
".\n";
636 pmapActualPrivate = &mapPrivate;
637 pmapActualPublic = &mapPublic;
647 pmapActualPrivate = pmapPrivate;
648 pmapActualPublic = pmapPublic;
676 if ((
nullptr != pstrSourceForNymID) &&
677 pstrSourceForNymID->
Exists())
688 pstrSourceToUse = pstrSourceForNymID;
690 if (!bChangeNymID && m_strSourceForNymID.
Exists() &&
691 !pstrSourceForNymID->
Compare(m_strSourceForNymID)) {
692 otErr <<
"In " << __FILE__ <<
", line " << __LINE__
693 <<
", OTPseudonym::" << __FUNCTION__
694 <<
": The Nym already has a source, but a different "
695 "source was passed in (they should be identical, since "
696 "you can't change a Nym's "
697 "source without changing his ID.)\n";
705 if (m_strSourceForNymID.
Exists())
706 strTempSource = m_strSourceForNymID;
716 otErr <<
"In " << __FILE__ <<
", line " << __LINE__
717 <<
", OTPseudonym::" << __FUNCTION__
718 <<
": Error: The Nym had no ID source, nor were we able "
719 "to derive one from his (non-existent) public key.\n";
723 pstrSourceToUse = &strTempSource;
731 if (!bChangeNymID && !
CompareID(theTempID)) {
738 const OTString strKeypairNymID(theKeypairNymID),
739 strCalculatedNymID(theTempID);
741 otOut << __FUNCTION__
742 <<
": No NymID Source was passed in, so I tried to use the "
743 "existing source (or if that was missing, the existing "
745 "the Nym, but hashing that failed to produce the Nym's "
746 "ID. Meaning the Nym must have "
747 "some other source already, which needs to be passed into "
748 "this function, for it to work on this Nym.\n"
749 "NOTE: Pass 'bChangeNymID' into this function as true, if "
750 "you want to override this behavior.\n"
751 "NYM ID: " << strNymID
752 <<
" \n KEY PAIR CALCULATED ID: " << strKeypairNymID
753 <<
" \n CONTENTS CALCULATED ID: " << strCalculatedNymID
754 <<
" \n NYM ID SOURCE: " << pstrSourceToUse->
Get() <<
"\n";
771 if (!m_mapCredentials.empty()) {
772 for (
auto& it : m_mapCredentials) {
778 otOut << __FUNCTION__
779 <<
": Attempt to add new master credential failed to "
780 "match the NymID Source on an existing master "
793 otErr << __FUNCTION__
794 <<
": Failure: cannot change NymID for Nym who "
795 "already has credentials.\n";
802 if (bChangeNymID && (!m_mapRequestNum.empty())) {
803 otErr << __FUNCTION__ <<
": Failure: cannot change NymID for Nym who "
804 "already is registered at "
805 "transaction servers.\n";
817 *pstrSourceToUse, nBits, pmapActualPrivate, pmapActualPublic, pPWData);
819 if (
nullptr == pMaster)
821 otErr << __FUNCTION__ <<
": Failed trying to create a new master "
822 "credential, while calling "
823 "OTCredential::CreateMaster.\n";
848 const OTString strTempID(theTempID);
849 otErr << __FUNCTION__
850 <<
": Failed trying to verify the new master credential.\n"
851 "Nym ID: " << strNymID <<
"\nHash of Source: " << strTempID
852 <<
"\n Source: " << pstrSourceToUse->
Get() <<
"\n";
864 otErr << __FUNCTION__
865 <<
": Failure: Apparently there is already a credential stored "
866 "for this ID (even though this is a new master credential, "
867 "just generated.)\n";
877 OTString strFoldername, strFilename;
883 .SaveContract(strFoldername.
Get(), strFilename.
Get());
886 otErr << __FUNCTION__ <<
": Failed trying to save new master "
887 "credential to local storage.\n";
893 m_mapCredentials.insert(std::pair<std::string, OTCredential*>(
897 m_strSourceForNymID = *pstrSourceToUse;
922 const OTString strMasterCredID(idMasterCredential);
924 auto it = m_mapCredentials.find(strMasterCredID.
Get());
926 if (it == m_mapCredentials.end())
928 otOut << __FUNCTION__ <<
": Failed trying to add key credential to "
929 "nonexistent master credential.\n";
938 pMaster->
AddNewSubkey(nBits, pmapPrivate, pPWData, &pSubkey);
943 <<
": Failed trying to add key credential to master credential.\n";
950 otErr <<
"NYM::ADD_NEW_SUBKEY: 2.5 \n";
952 otErr << __FUNCTION__
953 <<
": Failed trying to verify the new key credential.\n";
970 strSubkeyID.
Get())) {
971 otErr << __FUNCTION__
972 <<
": Failure: Apparently there is already a credential stored "
973 "for this ID (even though this is a new credential, just "
978 OTString strFoldername, strFilename;
981 strFilename.
Format(
"%s", strSubkeyID.
Get());
987 <<
": Failed trying to save new key credential to local storage.\n";
993 if (
nullptr != pstrNewID) *pstrNewID = strSubkeyID;
1010 const OTString strMasterCredID(idMasterCredential);
1012 auto it = m_mapCredentials.find(strMasterCredID.
Get());
1014 if (it == m_mapCredentials.end())
1016 otOut << __FUNCTION__ <<
": Failed trying to add subcredential to "
1017 "nonexistent master credential.\n";
1026 pPWData, &pSubcredential);
1029 otOut << __FUNCTION__
1030 <<
": Failed trying to add subcredential to master credential.\n";
1036 otErr << __FUNCTION__
1037 <<
": Failed trying to verify the new subcredential.\n";
1046 OTString strNymID, strSubcredentialID;
1051 strSubcredentialID.
Get())) {
1052 otErr << __FUNCTION__
1053 <<
": Failure: Apparently there is already a credential stored "
1054 "for this ID (even though this is a new credential, just "
1059 OTString strFoldername, strFilename;
1062 strFilename.
Format(
"%s", strSubcredentialID.
Get());
1068 <<
": Failed trying to save new subcredential to local storage.\n";
1085 m_dequeMail.push_front(&theMessage);
1091 return static_cast<int32_t
>(m_dequeMail.size());
1098 const uint32_t uIndex = nIndex;
1101 if (m_dequeMail.empty() || (nIndex < 0) || (uIndex >= m_dequeMail.size()))
1104 return m_dequeMail.at(nIndex);
1110 const uint32_t uIndex = nIndex;
1113 if (m_dequeMail.empty() || (nIndex < 0) || (uIndex >= m_dequeMail.size()))
1116 OTMessage* pMessage = m_dequeMail.at(nIndex);
1120 m_dequeMail.erase(m_dequeMail.begin() + nIndex);
1140 m_dequeOutmail.push_front(&theMessage);
1146 return static_cast<int32_t
>(m_dequeOutmail.size());
1153 const uint32_t uIndex = nIndex;
1156 if (m_dequeOutmail.empty() || (nIndex < 0) ||
1157 (uIndex >= m_dequeOutmail.size()))
1160 return m_dequeOutmail.at(nIndex);
1167 const uint32_t uIndex = nIndex;
1170 if (m_dequeOutmail.empty() || (nIndex < 0) ||
1171 (uIndex >= m_dequeOutmail.size()))
1174 OTMessage* pMessage = m_dequeOutmail.at(nIndex);
1178 m_dequeOutmail.erase(m_dequeOutmail.begin() + nIndex);
1200 m_dequeOutpayments.push_front(&theMessage);
1206 return static_cast<int32_t
>(m_dequeOutpayments.size());
1213 const uint32_t uIndex = nIndex;
1216 if (m_dequeOutpayments.empty() || (nIndex < 0) ||
1217 (uIndex >= m_dequeOutpayments.size()))
1220 return m_dequeOutpayments.at(nIndex);
1226 const uint32_t uIndex = nIndex;
1229 if (m_dequeOutpayments.empty() || (nIndex < 0) ||
1230 (uIndex >= m_dequeOutpayments.size())) {
1231 otErr << __FUNCTION__
1232 <<
": Error: Index out of bounds: signed: " << nIndex
1233 <<
" unsigned: " << uIndex <<
" (size is "
1234 << m_dequeOutpayments.size() <<
").\n";
1238 OTMessage* pMessage = m_dequeOutpayments.at(nIndex);
1241 m_dequeOutpayments.erase(m_dequeOutpayments.begin() + uIndex);
1243 if (bDeleteIt)
delete pMessage;
1274 if ((theOwner.
GetUserID() != m_nymID)) {
1275 otErr <<
"OTPseudonym::" << __FUNCTION__
1276 <<
": Transaction has wrong owner (expected to match nym).\n";
1290 if (
nullptr == pBalanceItem)
return nullptr;
1334 OTString strMessageNym(theMessageNym);
1347 return pBalanceItem;
1361 const bool bSuccess =
1376 if (m_strSourceForNymID.
Exists())
1382 otErr << __FUNCTION__ <<
": Error calculating Nym ID (as a digest "
1383 "of Nym's public (signing) key.)\n";
1396 const OTString strFilenameByID(m_nymID);
1401 strFilenameByID.
Get())))
1406 otErr << __FUNCTION__
1407 <<
": Failure storing cert for new nym: " << strFilenameByID
1423 std::string str_id_source,
1424 std::string str_alt_location)
1430 OTString strSource(str_id_source), strAltLocation(str_alt_location);
1435 OTString strReason(
"Creating new Nym.");
1443 if (bSaved && bCreateFile) {
1450 if (bCreateFile && !bSaved)
1451 otErr << __FUNCTION__
1452 <<
": Failed trying to save new Nym's cert or nymfile.\n";
1486 (str_id_source.size() > 0) ? &strSource :
nullptr, nBits);
1488 if (bAddedMaster && strMasterCredID.
Exists() &&
1491 const bool bAddedSubkey =
AddNewSubkey(theMasterCredID);
1498 otErr << __FUNCTION__ <<
": Failed trying to add new "
1499 "keyCredential to new Master "
1505 otErr << __FUNCTION__ <<
": Failed trying to add new master "
1506 "credential to new Nym.\n";
1524 otErr << __FUNCTION__ <<
": Error calculating Nym ID in "
1525 "OTAsymmetricKey::CalculateID().\n";
1535 #ifndef CLEAR_MAP_AND_DEQUE
1536 #define CLEAR_MAP_AND_DEQUE(the_map) \
1537 for (auto& it : the_map) { \
1538 if ((nullptr != pstrServerID) && (str_ServerID != it.first)) continue; \
1539 dequeOfTransNums* pDeque = (it.second); \
1540 OT_ASSERT(nullptr != pDeque); \
1541 if (!(pDeque->empty())) pDeque->clear(); \
1543 #endif // CLEAR_MAP_AND_DEQUE
1550 bool bRemoveHighestNum)
1555 std::string str_ServerID(pstrServerID ? pstrServerID->
Get() :
"");
1564 std::list<mapOfHighestNums::iterator> listOfHighestNums;
1565 std::list<mapOfIdentifiers::iterator> listOfNymboxHash;
1566 std::list<mapOfIdentifiers::iterator> listOfInboxHash;
1567 std::list<mapOfIdentifiers::iterator> listOfOutboxHash;
1568 std::list<mapOfIdentifiers::iterator> listOfRecentHash;
1570 if (bRemoveHighestNum) {
1571 for (
auto it(m_mapHighTransNo.begin()); it != m_mapHighTransNo.end();
1573 if ((
nullptr != pstrServerID) &&
1574 (str_ServerID != it->first))
1579 listOfHighestNums.push_back(it);
1583 for (
auto it(m_mapNymboxHash.begin()); it != m_mapNymboxHash.end(); ++it) {
1584 if ((
nullptr != pstrServerID) &&
1585 (str_ServerID != it->first))
1589 listOfNymboxHash.push_back(it);
1594 for (
auto it(m_mapInboxHash.begin()); it != m_mapInboxHash.end(); ++it) {
1595 listOfInboxHash.push_back(it);
1600 for (
auto it(m_mapOutboxHash.begin()); it != m_mapOutboxHash.end(); ++it) {
1601 listOfOutboxHash.push_back(it);
1604 for (
auto it(m_mapRecentHash.begin()); it != m_mapRecentHash.end(); ++it) {
1605 if ((
nullptr != pstrServerID) &&
1606 (str_ServerID != it->first))
1610 listOfRecentHash.push_back(it);
1613 while (!listOfHighestNums.empty()) {
1614 m_mapHighTransNo.erase(listOfHighestNums.back());
1615 listOfHighestNums.pop_back();
1617 while (!listOfNymboxHash.empty()) {
1618 m_mapNymboxHash.erase(listOfNymboxHash.back());
1619 listOfNymboxHash.pop_back();
1621 while (!listOfInboxHash.empty()) {
1622 m_mapInboxHash.erase(listOfInboxHash.back());
1623 listOfInboxHash.pop_back();
1625 while (!listOfOutboxHash.empty()) {
1626 m_mapOutboxHash.erase(listOfOutboxHash.back());
1627 listOfOutboxHash.pop_back();
1629 while (!listOfRecentHash.empty()) {
1630 m_mapRecentHash.erase(listOfRecentHash.back());
1631 listOfRecentHash.pop_back();
1644 OTLedger theNymbox(m_nymID, m_nymID, theServerID);
1656 m_NymboxHash = theInput;
1662 return GetHash(m_mapNymboxHash, server_id, theOutput);
1668 return SetHash(m_mapNymboxHash, server_id, theInput);
1674 return GetHash(m_mapRecentHash, server_id, theOutput);
1680 return SetHash(m_mapRecentHash, server_id, theInput);
1686 return GetHash(m_mapInboxHash, acct_id, theOutput);
1692 return SetHash(m_mapInboxHash, acct_id, theInput);
1698 return GetHash(m_mapOutboxHash, acct_id, theOutput);
1704 return SetHash(m_mapOutboxHash, acct_id, theInput);
1708 const std::string& str_id,
1713 theOutput.Release();
1726 for (
const auto& it : the_map) {
1727 if (str_id == it.first) {
1730 theOutput = it.second;
1738 bool OTPseudonym::SetHash(
mapOfIdentifiers& the_map,
const std::string& str_id,
1739 const OTIdentifier& theInput)
1741 bool bSuccess =
false;
1743 auto find_it = the_map.find(str_id);
1745 if (the_map.end() != find_it)
1748 the_map.erase(find_it);
1749 the_map[str_id] = theInput;
1758 the_map[str_id] = theInput;
1771 const std::string str_ServerID(pstrServerID ? pstrServerID->
Get() :
"");
1773 for (
auto it(m_mapRequestNum.begin()); it != m_mapRequestNum.end(); ++it) {
1774 if ((
nullptr != pstrServerID) &&
1775 (str_ServerID != it->first))
1779 m_mapRequestNum.erase(it);
1792 bool bRetVal =
false;
1794 std::string strID = strServerID.
Get();
1803 for (
auto& it : m_mapRequestNum) {
1804 if (strID == it.first) {
1821 bool bRetVal =
false;
1823 std::string strID = strServerID.
Get();
1833 for (
auto it(m_mapRequestNum.begin()); it != m_mapRequestNum.end(); ++it) {
1834 if (strID == it->first) {
1837 m_mapRequestNum.erase(it);
1845 #ifndef WIPE_MAP_AND_DEQUE
1846 #define WIPE_MAP_AND_DEQUE(the_map) \
1847 while (!the_map.empty()) { \
1848 dequeOfTransNums* pDeque = the_map.begin()->second; \
1849 OT_ASSERT(nullptr != pDeque); \
1850 the_map.erase(the_map.begin()); \
1854 #endif // WIPE_MAP_AND_DEQUE
1993 bool bSuccess =
true;
1996 const OTString strServerID(theServerID);
1999 const int32_t nIssuedNumCount =
2001 const int32_t nTransNumCount =
2022 std::set<int64_t> setTransNumbers;
2031 for (int32_t n1 = 0; n1 < nIssuedNumCount; ++n1) {
2032 const int64_t lNum = theMessageNym.
GetIssuedNum(theServerID, n1);
2039 otErr <<
"OTPseudonym::ResyncWithServer: Failed trying to add "
2040 "IssuedNum (" << lNum <<
") onto *this nym: " << strNymID
2041 <<
", for server: " << strServerID <<
"\n";
2045 setTransNumbers.insert(lNum);
2047 otWarn <<
"OTPseudonym::ResyncWithServer: Added IssuedNum (" << lNum
2048 <<
") onto *this nym: " << strNymID
2049 <<
", for server: " << strServerID <<
" \n";
2053 for (int32_t n2 = 0; n2 < nTransNumCount; ++n2) {
2060 otErr <<
"OTPseudonym::ResyncWithServer: Failed trying to add "
2061 "TransactionNum (" << lNum
2062 <<
") onto *this nym: " << strNymID
2063 <<
", for server: " << strServerID <<
"\n";
2067 setTransNumbers.insert(lNum);
2069 otWarn <<
"OTPseudonym::ResyncWithServer: Added TransactionNum ("
2070 << lNum <<
") onto *this nym: " << strNymID
2071 <<
", for server: " << strServerID <<
" \n";
2093 const int64_t lNum =
2102 otErr <<
"OTPseudonym::ResyncWithServer: Failed trying to add "
2103 "TentativeNum (" << lNum
2104 <<
") onto *this nym: " << strNymID
2105 <<
", for server: " << strServerID <<
"\n";
2109 otWarn <<
"OTPseudonym::ResyncWithServer: Added TentativeNum ("
2110 << lNum <<
") onto *this nym: " << strNymID
2111 <<
", for server: " << strServerID <<
" \n";
2127 const std::string strID = strServerID.
Get();
2129 for (
auto& it_high_num : m_mapHighTransNo) {
2131 if (strID == it_high_num.first) {
2135 for (
auto& it : setTransNumbers) {
2136 const int64_t lTransNum = it;
2139 const int64_t lOldHighestNumber = it_high_num.second;
2141 if (lTransNum > lOldHighestNumber)
2144 m_mapHighTransNo[it_high_num.first] = lTransNum;
2146 <<
"OTPseudonym::ResyncWithServer: Updated HighestNum ("
2147 << lTransNum <<
") record on *this nym: " << strNymID
2148 <<
", for server: " << strServerID <<
" \n";
2170 const int64_t& lTransNum)
const
2172 std::string strID = strServerID.
Get();
2183 for (
auto& it : THE_MAP) {
2185 if (strID == it.first) {
2189 if (!(pDeque->empty()))
2192 for (uint32_t i = 0; i < pDeque->size(); i++) {
2194 if (lTransNum == pDeque->at(i)) {
2211 const int64_t& lTransNum)
2229 const int64_t& lTransNum)
2231 bool bRetVal =
false;
2232 std::string strID = strServerID.
Get();
2243 for (
auto& it : THE_MAP) {
2245 if (strID == it.first) {
2250 if (!(pDeque->empty()))
2253 for (uint32_t i = 0; i < pDeque->size(); i++) {
2255 if (lTransNum == pDeque->at(i)) {
2256 pDeque->erase(pDeque->begin() + i);
2272 const OTString& strServerID, int64_t lTransNum)
2274 bool bSuccessFindingServerID =
false, bSuccess =
false;
2275 std::string strID = strServerID.
Get();
2285 for (
auto& it : THE_MAP) {
2287 if (strID == it.first) {
2291 auto iter = std::find(pDeque->begin(), pDeque->end(), lTransNum);
2293 if (iter == pDeque->end())
2295 pDeque->push_front(lTransNum);
2298 bSuccessFindingServerID =
true;
2307 if (!bSuccessFindingServerID) {
2312 THE_MAP[strID] = pDeque;
2313 pDeque->push_front(lTransNum);
2325 int32_t nReturnValue = 0;
2327 const OTString strServerID(theServerID);
2328 std::string strID = strServerID.
Get();
2338 for (
auto& it : THE_MAP) {
2340 if (strID == it.first) {
2341 pDeque = (it.second);
2350 if (
nullptr != pDeque) {
2351 nReturnValue =
static_cast<int32_t
>(pDeque->size());
2354 return nReturnValue;
2360 int32_t nIndex)
const
2362 int64_t lRetVal = 0;
2364 const OTString strServerID(theServerID);
2365 std::string strID = strServerID.
Get();
2374 for (
auto& it : THE_MAP) {
2376 if (strID == it.first) {
2380 if (!(pDeque->empty()))
2383 for (uint32_t i = 0; i < pDeque->size(); i++) {
2385 if ((uint32_t)nIndex == i) {
2386 lRetVal = pDeque->at(i);
2400 int32_t nIndex)
const
2402 return GetGenericNum(m_mapTentativeNum, theServerID, nIndex);
2407 int32_t nIndex)
const
2414 int32_t nIndex)
const
2421 int32_t nIndex)
const
2423 return GetGenericNum(m_mapAcknowledgedNum, theServerID, nIndex);
2431 const OTString& strServerID,
const int64_t& lTransNum)
const
2433 return VerifyGenericNum(m_mapTransNum, strServerID, lTransNum);
2440 const int64_t& lTransNum)
2442 return RemoveGenericNum(m_mapTransNum, SIGNER_NYM, strServerID, lTransNum);
2446 const int64_t& lTransNum)
2465 return AddGenericNum(m_mapTransNum, strServerID, lTransNum);
2473 const int64_t& lTransNum)
const
2482 const int64_t& lTransNum)
2484 return RemoveGenericNum(m_mapIssuedNum, SIGNER_NYM, strServerID, lTransNum);
2488 const int64_t& lTransNum)
2503 const int64_t& lTransNum)
2505 return AddGenericNum(m_mapIssuedNum, strServerID, lTransNum);
2513 const int64_t& lTransNum)
const
2522 const int64_t& lTransNum)
2529 const int64_t& lTransNum)
2544 const int64_t& lTransNum)
2546 return AddGenericNum(m_mapTentativeNum, strServerID, lTransNum);
2563 const int64_t& lRequestNum)
const
2575 const int64_t& lRequestNum)
2582 const int64_t& lRequestNum)
2600 #ifndef OT_MAX_ACK_NUMS
2601 #define OT_MAX_ACK_NUMS 100
2607 const int64_t& lRequestNum)
2614 std::string strID = strServerID.
Get();
2627 for (
auto& it : m_mapAcknowledgedNum) {
2629 if (strID == it.first) {
2666 if (bSuccess1 && !bSuccess2)
2668 else if (bSuccess2 && !bSuccess1)
2671 if (bSuccess1 && bSuccess2 && bSave)
2676 return (bSuccess1 && bSuccess2 && bSave);
2689 const int64_t& lTransNum,
2694 strServerID, lTransNum);
2698 if (bSuccess && bSave)
2703 return (bSuccess && bSave);
2715 const int64_t& lTransNum,
2723 if (bSuccess && bSave)
2728 return (bSuccess && bSave);
2742 const int64_t& lRequestNum,
2750 if (bSuccess && bSave)
2755 return (bSuccess && bSave);
2770 int64_t lTransactionNumber = 0;
2772 std::set<int64_t> setInput, setOutputGood, setOutputBad;
2775 std::string strServerID = it.first;
2780 OTString OTstrServerID = strServerID.c_str();
2783 if (!(pDeque->empty()) &&
2784 (theServerID == theTempID))
2786 for (uint32_t i = 0; i < pDeque->size(); i++) {
2787 lTransactionNumber = pDeque->at(i);
2798 lTransactionNumber)) &&
2804 lTransactionNumber))
2808 setInput.insert(lTransactionNumber);
2818 if (!setInput.empty()) {
2819 const OTString strServerID(theServerID), strNymID(m_nymID);
2822 SIGNER_NYM, strServerID, setInput, setOutputGood,
2842 if ((-1) == lViolator)
2843 otErr <<
"OTPseudonym::HarvestTransactionNumbers"
2844 <<
": ERROR: UpdateHighestNum() returned (-1), "
2845 "which is an error condition. "
2846 "(Should never happen.)\nNym ID: " << strNymID <<
" \n";
2852 for (
auto& it : setOutputGood) {
2853 const int64_t lNoticeNum = it;
2862 strServerID, lNoticeNum);
2904 bool bChangedTheNym =
false;
2905 int64_t lTransactionNumber = 0;
2908 std::string strServerID = it.first;
2914 ((strServerID.size()) > 0 ? strServerID.c_str() :
"");
2917 if (!(pDeque->empty()) && (theServerID == theTempID)) {
2918 for (uint32_t i = 0; i < pDeque->size(); i++) {
2919 lTransactionNumber = pDeque->at(i);
2931 SIGNER_NYM, OTstrServerID, lTransactionNumber,
2933 bChangedTheNym =
true;
2940 if (bChangedTheNym && bSave) {
2953 const int64_t& lTransClawback,
2959 if (
nullptr == pSIGNER_NYM) pSIGNER_NYM =
this;
2962 const OTString strServerID(theServerID);
2982 int64_t& lTransNum,
bool bSave)
2984 bool bRetVal =
false;
2985 std::string strID = strServerID.
Get();
2995 for (
auto& it : m_mapTransNum) {
2997 if (strID == it.first) {
3001 if (!(pDeque->empty())) {
3002 lTransNum = pDeque->front();
3004 pDeque->pop_front();
3013 if (bRetVal && bSave) {
3015 otErr <<
"Error saving signed NymFile in "
3016 "OTPseudonym::GetNextTransactionNum\n";
3027 int64_t& lHighestNum)
const
3029 bool bRetVal =
false;
3030 std::string strID = strServerID.
Get();
3047 for (
auto& it : m_mapHighTransNo) {
3048 if (strID == it.first) {
3050 lHighestNum = (it.second);
3078 std::set<int64_t>& setNumbers,
3079 std::set<int64_t>& setOutputGood,
3080 std::set<int64_t>& setOutputBad,
3083 bool bFoundServerID =
false;
3084 int64_t lReturnVal = 0;
3088 int64_t lHighestInSet = 0;
3089 int64_t lLowestInSet = 0;
3091 for (
auto& it : setNumbers) {
3092 const int64_t lSetNum = it;
3094 if (lSetNum > lHighestInSet)
3095 lHighestInSet = lSetNum;
3098 if (0 == lLowestInSet)
3099 lLowestInSet = lSetNum;
3102 else if (lSetNum < lLowestInSet)
3103 lLowestInSet = lSetNum;
3124 std::string strID = strServerID.
Get();
3126 for (
auto& it : m_mapHighTransNo) {
3130 if (strID == it.first)
3142 const int64_t lOldHighestNumber =
3154 for (
auto& it_numbers : setNumbers) {
3155 const int64_t lSetNum = it_numbers;
3162 if (lSetNum <= lOldHighestNumber) {
3163 otWarn <<
"OTPseudonym::UpdateHighestNum: New transaction "
3164 "number is less-than-or-equal-to "
3165 "last known 'highest trans number' record. (Must "
3166 "be seeing the same server reply for "
3167 "a second time, due to a receipt in my Nymbox.) "
3168 "FYI, last known 'highest' number received: "
3169 << lOldHighestNumber
3170 <<
" (Current 'violator': " << lSetNum
3171 <<
") Skipping...\n";
3172 setOutputBad.insert(lSetNum);
3181 setOutputGood.insert(lSetNum);
3192 if ((lLowestInSet > 0) &&
3193 (lLowestInSet <= lOldHighestNumber))
3199 lReturnVal = lLowestInSet;
3205 bFoundServerID =
true;
3254 if (!setOutputGood.empty())
3256 if (bFoundServerID) {
3257 otOut <<
"OTPseudonym::UpdateHighestNum: Raising Highest Trans "
3258 "Number from " << m_mapHighTransNo[strID] <<
" to "
3259 << lHighestInSet <<
".\n";
3264 m_mapHighTransNo.erase(strID);
3265 m_mapHighTransNo.insert(
3266 std::pair<std::string, int64_t>(strID, lHighestInSet));
3277 otOut <<
"OTPseudonym::UpdateHighestNum: Creating "
3278 "Highest Transaction Number entry for this server as '"
3279 << lHighestInSet <<
"'.\n";
3280 m_mapHighTransNo.insert(
3281 std::pair<std::string, int64_t>(strID, lHighestInSet));
3319 int64_t& lReqNum)
const
3321 bool bRetVal =
false;
3322 std::string strID = strServerID.
Get();
3332 for (
auto& it : m_mapRequestNum) {
3333 if (strID == it.first) {
3335 lReqNum = (it.second);
3357 bool bSuccess =
false;
3370 std::string strID = strServerID.
Get();
3372 for (
auto& it : m_mapRequestNum) {
3373 if (strID == it.first) {
3382 int64_t lOldRequestNumber = m_mapRequestNum[it.first];
3385 m_mapRequestNum[it.first] = lOldRequestNumber + 1;
3388 otLog4 <<
"Incremented Request Number from " << lOldRequestNumber
3389 <<
" to " << m_mapRequestNum[it.first] <<
". Saving...\n";
3402 otOut <<
"Creating Request Number entry as '100'. Saving...\n";
3403 m_mapRequestNum[strServerID.
Get()] = 100;
3415 int64_t lNewRequestNumber)
3417 bool bSuccess =
false;
3430 std::string strID = strServerID.
Get();
3432 for (
auto& it : m_mapRequestNum) {
3433 if (strID == it.first) {
3445 int64_t lOldRequestNumber = m_mapRequestNum[it.first];
3448 m_mapRequestNum[it.first] = lNewRequestNumber;
3451 otLog4 <<
"Updated Request Number from " << lOldRequestNumber
3452 <<
" to " << m_mapRequestNum[it.first] <<
". Saving...\n";
3462 otOut <<
"Creating Request Number entry as '" << lNewRequestNumber
3463 <<
"'. Saving...\n";
3464 m_mapRequestNum[strServerID.
Get()] = lNewRequestNumber;
3475 return m_mapCredentials.size();
3480 return m_mapRevoked.size();
3531 if (!m_mapCredentials.empty()) {
3533 for (
const auto& it : m_mapCredentials) {
3541 otOut << __FUNCTION__ <<
": Credential NymID ("
3543 <<
") doesn't match actual NymID: " << strNymID <<
"\n";
3548 otOut << __FUNCTION__ <<
": Credential ("
3550 <<
") failed its own internal verification.\n";
3568 <<
": Credential failed against its source. Credential ID: "
3571 "NymID: " << pCredential->
GetNymID()
3593 auto it = m_mapCredentials.begin();
3594 OT_ASSERT(m_mapCredentials.end() != it);
3600 if (const_cast<OTKeypair&>(
3601 pCredential->GetSignKeypair(&m_listRevokedIDs))
3602 .GetPublicKey(strSigningKey,
false))
3606 otErr << __FUNCTION__ <<
": Failed in call to "
3607 "pCredential->GetPublicSignKey()."
3624 bool bGotPublicKey = m_pkeypair->
GetPublicKey(strPublicKey);
3626 if (!bGotPublicKey) {
3627 otErr <<
"Error getting public key in "
3628 "OTPseudonym::VerifyPseudonym.\n";
3635 if (!bSuccessCalculateDigest) {
3636 otErr <<
"Error calculating pubkey digest.\n";
3648 if (m_nymID != newID) {
3649 OTString str1(m_nymID), str2(newID);
3650 otErr <<
"\nHashes do NOT match in OTPseudonym::VerifyPseudonym!\n"
3651 << str1 <<
"\n" << str2 <<
"\n";
3685 " nymID=\"%s\" />\n\n",
3686 ascName.
Get(), nymID.
Get());
3708 const char* szFilename = strPath.
Get();
3730 otErr <<
"Failure in OTPseudonym::SavePublicKey while saving to "
3732 << szFilename <<
"\n";
3737 otErr <<
"Error in OTPseudonym::SavePublicKey: unable to GetPublicKey "
3763 otErr <<
"Error in OTPseudonym::SavePublicKey: unable to GetPublicKey "
3778 if (
nullptr == pstrID) {
3880 <<
": Failed load: "
3881 "Apparently this Nym doesn't exist. (Returning.)\n";
3886 const char* szFilename = strID.
Get();
3888 const OTString strFoldername(szFoldername), strFilename(szFilename);
3896 const bool bCanLoadKeyFile =
OTDB::Exists(szFoldername, szFilename);
3898 if (bCanLoadKeyFile) {
3899 if (!m_pkeypair->
LoadPublicKey(strFoldername, strFilename)) {
3900 otErr << __FUNCTION__ <<
": Although the ascii-armored file ("
3902 <<
") was read, LoadPublicKey returned false.\n";
3907 <<
": Successfully loaded public key from file: "
3914 otInfo << __FUNCTION__ <<
": Failure.\n";
3922 for (
auto& it : m_mapRequestNum) {
3923 std::string strServerID = it.first;
3924 int64_t lRequestNumber = it.second;
3927 strOutput.
Concatenate(
"Req# is %lld for server ID: %s\n",
3928 lRequestNumber, strServerID.c_str());
3931 for (
auto& it : m_mapHighTransNo) {
3932 std::string strServerID = it.first;
3933 const int64_t lHighestNum = it.second;
3935 strOutput.
Concatenate(
"Highest trans# was %lld for server: %s\n",
3936 lHighestNum, strServerID.c_str());
3939 for (
auto& it : m_mapIssuedNum) {
3940 std::string strServerID = it.first;
3945 if (!(pDeque->empty())) {
3947 "---- Transaction numbers still signed out from server: %s\n",
3948 strServerID.c_str());
3950 for (uint32_t i = 0; i < pDeque->size(); i++) {
3951 int64_t lTransactionNumber = pDeque->at(i);
3954 lTransactionNumber);
3960 for (
auto& it : m_mapTransNum) {
3961 std::string strServerID = it.first;
3966 if (!(pDeque->empty())) {
3968 "---- Transaction numbers still usable on server: %s\n",
3969 strServerID.c_str());
3971 for (uint32_t i = 0; i < pDeque->size(); i++) {
3972 int64_t lTransactionNumber = pDeque->at(i);
3974 lTransactionNumber);
3980 for (
auto& it : m_mapAcknowledgedNum) {
3981 std::string strServerID = it.first;
3986 if (!(pDeque->empty())) {
3987 strOutput.
Concatenate(
"---- Request numbers for which Nym has "
3988 "already received a reply from server: %s\n",
3989 strServerID.c_str());
3991 for (uint32_t i = 0; i < pDeque->size(); i++) {
3992 int64_t lRequestNumber = pDeque->at(i);
4000 strOutput.
Concatenate(
"Source for ID:\n%s\n", m_strSourceForNymID.
Get());
4001 strOutput.
Concatenate(
"Alt. location: %s\n\n", m_strAltLocation.
Get());
4004 if (nMasterCredCount > 0) {
4005 for (int32_t iii = 0; iii < static_cast<int64_t>(nMasterCredCount);
4008 if (
nullptr != pCredential) {
4011 const size_t nSubcredentialCount =
4014 if (nSubcredentialCount > 0) {
4015 for (
size_t vvv = 0; vvv < nSubcredentialCount; ++vvv) {
4016 const std::string str_subcred_id(
4020 str_subcred_id.c_str());
4029 m_bMarkForDeletion ?
"(MARKED FOR DELETION)" :
"");
4038 strOutput.
Concatenate(
" Mail count: %d\n", m_dequeMail.size());
4039 strOutput.
Concatenate(
" Outmail count: %d\n", m_dequeOutmail.size());
4040 strOutput.
Concatenate(
"Outpayments count: %d\n", m_dequeOutpayments.size());
4056 << m_strNymfile <<
"\n";
4062 const char* szFilename)
4073 otErr << __FUNCTION__ <<
": Error saving file: " << szFoldername
4096 const OTPassword* pExportPassphrase =
nullptr;
4097 std::unique_ptr<const OTPassword> thePasswordAngel;
4099 if (
nullptr == pImportPassword) {
4108 : (bImporting ?
"Enter passphrase for the Nym being imported."
4109 :
"Enter passphrase for exported Nym."));
4112 &strDisplay, !bImporting);
4115 thePasswordAngel.reset(pExportPassphrase);
4117 if (
nullptr == pExportPassphrase) {
4118 otErr << __FUNCTION__ <<
": Failed in GetPassphraseFromUser.\n";
4129 pExportPassphrase = pImportPassword;
4137 for (
auto& it : m_mapCredentials) {
4166 strCredList.
Concatenate(
"<?xml version=\"%s\"?>\n",
4169 strCredList.
Concatenate(
"<OTuser version=\"%s\"\n"
4172 m_strVersion.
Get(), strNymID.
Get());
4176 for (
auto& it : m_mapCredentials) {
4180 pCredential->
SerializeIDs(strCredList, m_listRevokedIDs,
4198 strCredList.
Concatenate(
"<?xml version=\"%s\"?>\n",
4201 strCredList.
Concatenate(
"<OTuser version=\"%s\"\n"
4204 m_strVersion.
Get(), strNymID.
Get());
4217 if (m_strSourceForNymID.
Exists()) {
4218 const OTASCIIArmor ascSourceForNymID(m_strSourceForNymID);
4220 if (m_strAltLocation.
Exists()) {
4222 ascAltLocation.
SetString(m_strAltLocation,
4226 "<nymIDSource altLocation=\"%s\">\n%s</nymIDSource>\n\n",
4227 ascAltLocation.
Get(), ascSourceForNymID.
Get());
4230 strOutput.
Concatenate(
"<nymIDSource>\n%s</nymIDSource>\n\n",
4231 ascSourceForNymID.
Get());
4246 m_strVersion.
Get(), strNymID.
Get());
4262 if (strOutput.
Exists()) {
4266 strOutput,
"CREDENTIAL LIST") &&
4271 strFilename.
Format(
"%s.cred", strNymID.
Get());
4278 strFilename.
Get())) {
4279 otErr << __FUNCTION__ <<
": Failure trying to store "
4281 <<
" credential list for Nym: " << strNymID <<
"\n";
4310 strFilename.
Format(
"%s.cred", strNymID.
Get());
4314 const char* szFilename = strFilename.
Get();
4349 &strReason, pImportPassword);
4361 otErr << __FUNCTION__
4362 <<
": Failed trying to load credential list from file: "
4379 for (
auto& it : m_listRevokedIDs) {
4380 std::string str_revoked_id = it;
4384 str_revoked_id.c_str());
4388 for (
auto& it : m_mapCredentials) {
4393 strOutput, m_listRevokedIDs, pmapPubInfo, pmapPriInfo,
4398 for (
auto& it : m_mapRevoked) {
4403 strOutput, m_listRevokedIDs, pmapPubInfo, pmapPriInfo,
true,
4415 strNym.
Concatenate(
"<?xml version=\"%s\"?>\n",
"2.0");
4417 if (m_lUsageCredits == 0)
4421 m_strVersion.
Get(), nymID.
Get());
4425 " usageCredits=\"%lld\""
4427 m_strVersion.
Get(), nymID.
Get(), m_lUsageCredits);
4442 for (
auto& it : m_mapRequestNum) {
4443 std::string strServerID = it.first;
4444 int64_t lRequestNum = it.second;
4447 " serverID=\"%s\"\n"
4448 " currentRequestNum=\"%lld\""
4450 strServerID.c_str(), lRequestNum);
4453 for (
auto& it : m_mapHighTransNo) {
4454 std::string strServerID = it.first;
4455 int64_t lHighestNum = it.second;
4458 " serverID=\"%s\"\n"
4459 " mostRecent=\"%lld\""
4461 strServerID.c_str(), lHighestNum);
4468 if (m_bMarkForDeletion)
4470 "<MARKED_FOR_DELETION>\n"
4471 "%s</MARKED_FOR_DELETION>\n\n",
4472 "THIS NYM HAS BEEN MARKED FOR DELETION AT ITS OWN REQUEST");
4474 int64_t lTransactionNumber = 0;
4476 for (
auto& it : m_mapTransNum) {
4477 std::string strServerID = it.first;
4498 if (!(pDeque->empty()) && (strServerID.size() > 0)) {
4501 for (uint32_t i = 0; i < pDeque->size(); i++) {
4502 lTransactionNumber = pDeque->at(i);
4503 theList.Add(lTransactionNumber);
4506 if ((theList.
Count() > 0) && theList.
Output(strTemp) &&
4512 "serverID=\"%s\">\n%s</"
4513 "transactionNums>\n\n",
4514 strServerID.c_str(), ascTemp.
Get());
4519 lTransactionNumber = 0;
4521 for (
auto& it : m_mapIssuedNum) {
4522 std::string strServerID = it.first;
4543 if (!(pDeque->empty()) && (strServerID.size() > 0)) {
4546 for (uint32_t i = 0; i < pDeque->size(); i++) {
4547 lTransactionNumber = pDeque->at(i);
4548 theList.Add(lTransactionNumber);
4551 if ((theList.
Count() > 0) && theList.
Output(strTemp) &&
4557 "<issuedNums serverID=\"%s\">\n%s</issuedNums>\n\n",
4558 strServerID.c_str(), ascTemp.
Get());
4563 lTransactionNumber = 0;
4565 for (
auto& it : m_mapTentativeNum) {
4566 std::string strServerID = it.first;
4587 if (!(pDeque->empty()) && (strServerID.size() > 0)) {
4590 for (uint32_t i = 0; i < pDeque->size(); i++) {
4591 lTransactionNumber = pDeque->at(i);
4592 theList.Add(lTransactionNumber);
4595 if ((theList.
Count() > 0) && theList.
Output(strTemp) &&
4601 "serverID=\"%s\">\n%s</"
4602 "tentativeNums>\n\n",
4603 strServerID.c_str(), ascTemp.
Get());
4615 for (
auto& it : m_mapAcknowledgedNum) {
4616 std::string strServerID = it.first;
4637 if (!(pDeque->empty()) && (strServerID.size() > 0)) {
4640 for (uint32_t i = 0; i < pDeque->size(); i++) {
4641 const int64_t lRequestNumber = pDeque->at(i);
4642 theList.Add(lRequestNumber);
4645 if ((theList.
Count() > 0) && theList.
Output(strTemp) &&
4651 "<ackNums serverID=\"%s\">\n%s</ackNums>\n\n",
4652 strServerID.c_str(), ascTemp.
Get());
4658 if (!(m_dequeMail.empty())) {
4659 for (uint32_t i = 0; i < m_dequeMail.size(); i++) {
4660 OTMessage* pMessage = m_dequeMail.at(i);
4671 "%s</mailMessage>\n\n",
4676 if (!(m_dequeOutmail.empty())) {
4677 for (uint32_t i = 0; i < m_dequeOutmail.size(); i++) {
4678 OTMessage* pMessage = m_dequeOutmail.at(i);
4689 "%s</outmailMessage>\n\n",
4694 if (!(m_dequeOutpayments.empty())) {
4695 for (uint32_t i = 0; i < m_dequeOutpayments.size(); i++) {
4696 OTMessage* pMessage = m_dequeOutpayments.at(i);
4699 OTString strOutpayments(*pMessage);
4703 if (strOutpayments.
Exists())
4704 ascOutpayments.
SetString(strOutpayments);
4706 if (ascOutpayments.
Exists())
4708 "%s</outpaymentsMessage>\n\n",
4709 ascOutpayments.
Get());
4716 if (!(m_setOpenCronItems.empty())) {
4717 for (
auto& it : m_setOpenCronItems) {
4718 strNym.
Concatenate(
"<hasOpenCronItem ID=\"%lld\" />\n\n", it);
4725 if (!(m_setAccounts.empty())) {
4726 for (
auto& it : m_setAccounts) {
4727 strNym.
Concatenate(
"<ownsAssetAcct ID=\"%s\" />\n\n", it.c_str());
4732 for (
auto& it : m_mapNymboxHash) {
4733 std::string strServerID = it.first;
4736 if ((strServerID.size() > 0) && !theID.
IsEmpty()) {
4737 const OTString strNymboxHash(theID);
4739 " serverID=\"%s\"\n"
4740 " nymboxHash=\"%s\""
4742 strServerID.c_str(), strNymboxHash.
Get());
4747 for (
auto& it : m_mapRecentHash) {
4748 std::string strServerID = it.first;
4751 if ((strServerID.size() > 0) && !theID.
IsEmpty()) {
4752 const OTString strRecentHash(theID);
4754 " serverID=\"%s\"\n"
4755 " recentHash=\"%s\""
4757 strServerID.c_str(), strRecentHash.
Get());
4762 if (!m_NymboxHash.
IsEmpty()) {
4763 const OTString strNymboxHash(m_NymboxHash);
4767 strNymboxHash.
Get());
4771 for (
auto& it : m_mapInboxHash) {
4772 std::string strAcctID = it.first;
4775 if ((strAcctID.size() > 0) && !theID.
IsEmpty()) {
4778 " accountID=\"%s\"\n"
4781 strAcctID.c_str(), strHash.
Get());
4786 for (
auto& it : m_mapOutboxHash) {
4787 std::string strAcctID = it.first;
4790 if ((strAcctID.size() > 0) && !theID.
IsEmpty()) {
4793 " accountID=\"%s\"\n"
4796 strAcctID.c_str(), strHash.
Get());
4807 auto iter = m_mapCredentials.find(strID.
Get());
4810 if (iter != m_mapCredentials.end())
4811 pCredential = iter->second;
4818 auto iter = m_mapRevoked.find(strID.
Get());
4821 if (iter != m_mapRevoked.end())
4822 pCredential = iter->second;
4828 int32_t nIndex)
const
4831 (nIndex >= static_cast<int64_t>(m_mapCredentials.size()))) {
4832 otErr << __FUNCTION__ <<
": Index out of bounds: " << nIndex <<
"\n";
4835 int32_t nLoopIndex = -1;
4837 for (
const auto& it : m_mapCredentials) {
4843 if (nLoopIndex == nIndex)
return pCredential;
4850 int32_t nIndex)
const
4852 if ((nIndex < 0) || (nIndex >= static_cast<int64_t>(m_mapRevoked.size()))) {
4853 otErr << __FUNCTION__ <<
": Index out of bounds: " << nIndex <<
"\n";
4856 int32_t nLoopIndex = -1;
4858 for (
const auto& it : m_mapRevoked) {
4864 if (nLoopIndex == nIndex)
return pCredential;
4873 auto iter = m_mapCredentials.find(strMasterID.
Get());
4876 if (iter != m_mapCredentials.end())
4877 pMaster = iter->second;
4879 if (
nullptr != pMaster) {
4883 if (
nullptr != pSub)
return pSub;
4896 auto iter = m_mapRevoked.find(strRevokedID.
Get());
4899 if (iter != m_mapRevoked.end())
4900 pMaster = iter->second;
4902 if (
nullptr != pMaster) {
4905 if (
nullptr != pSub)
return pSub;
4949 bool bSuccess =
false;
4957 std::unique_ptr<irr::io::IrrXMLReader> theCleanup(xml);
4960 while (xml && xml->read()) {
5002 switch (xml->getNodeType()) {
5003 case irr::io::EXN_NONE:
5004 case irr::io::EXN_TEXT:
5005 case irr::io::EXN_COMMENT:
5006 case irr::io::EXN_ELEMENT_END:
5007 case irr::io::EXN_CDATA:
5040 case irr::io::EXN_ELEMENT: {
5041 const OTString strNodeName = xml->getNodeName();
5045 if (strNodeName.
Compare(
"OTuser")) {
5046 m_strVersion = xml->getAttributeValue(
"version");
5047 const OTString UserNymID = xml->getAttributeValue(
"nymID");
5050 OTString strCredits = xml->getAttributeValue(
"usageCredits");
5053 m_lUsageCredits = atol(strCredits.
Get());
5065 otLog3 <<
"\nLoading user, version: " << m_strVersion
5066 <<
" NymID:\n" << UserNymID <<
"\n";
5069 else if (strNodeName.
Compare(
"nymIDSource")) {
5072 xml->getAttributeValue(
"altLocation");
5073 if (ascAltLocation.
Exists())
5079 m_strSourceForNymID)) {
5080 otErr <<
"Error in " << __FILE__ <<
" line " << __LINE__
5081 <<
": failed loading expected nymIDSource field.\n";
5085 else if (strNodeName.
Compare(
"revokedCredential")) {
5086 const OTString strRevokedID = xml->getAttributeValue(
"ID");
5087 otLog3 <<
"revokedCredential ID: " << strRevokedID <<
"\n";
5089 std::find(m_listRevokedIDs.begin(), m_listRevokedIDs.end(),
5090 strRevokedID.Get());
5091 if (iter == m_listRevokedIDs.end())
5093 m_listRevokedIDs.push_back(
5094 strRevokedID.Get());
5096 else if (strNodeName.
Compare(
"masterCredential")) {
5097 const OTString strID = xml->getAttributeValue(
"ID");
5098 const OTString strValid = xml->getAttributeValue(
"valid");
5099 const bool bValid = strValid.
Compare(
"true");
5100 otLog3 <<
"Loading " << (bValid ?
"valid" :
"invalid")
5101 <<
" masterCredential ID: " << strID <<
"\n";
5106 if (
nullptr == pMapCredentials)
5116 auto it_cred = pMapCredentials->find(strID.
Get());
5119 pMapCredentials->end())
5125 otErr << __FUNCTION__
5126 <<
": Expected master credential (" << strID
5127 <<
") on map of credentials, but couldn't find "
5132 const OTString strMasterCredential(
5133 it_cred->second.c_str());
5134 if (strMasterCredential.Exists()) {
5136 nullptr == pstrReason
5137 ?
"OTPseudonym::LoadFromString"
5138 : pstrReason->
Get());
5140 strMasterCredential, strNymID, strID,
5141 &thePWData, pImportPassword);
5146 if (
nullptr == pCredential) {
5147 otErr << __FUNCTION__
5148 <<
": Failed trying to load Master Credential ID: "
5155 bValid ? &m_mapCredentials : &m_mapRevoked;
5156 auto iter = pMap->find(strID.
Get());
5157 if (iter == pMap->end())
5159 pMap->insert(std::pair<std::string, OTCredential*>(
5160 strID.
Get(), pCredential));
5162 otErr << __FUNCTION__ <<
": While loading credential ("
5163 << strID <<
"), discovered it was already there "
5164 "on my list, or one with the exact "
5165 "same ID! Therefore, failed "
5166 "adding this newer one.\n";
5168 pCredential =
nullptr;
5173 else if (strNodeName.
Compare(
"keyCredential")) {
5174 const OTString strID = xml->getAttributeValue(
"ID");
5175 const OTString strValid = xml->getAttributeValue(
5179 xml->getAttributeValue(
"masterID");
5180 const bool bValid = strValid.
Compare(
"true");
5181 otLog3 <<
"Loading " << (bValid ?
"valid" :
"invalid")
5182 <<
" keyCredential ID: " << strID
5183 <<
"\n ...For master credential: " << strMasterCredID
5187 if (
nullptr == pCredential)
5189 if (
nullptr == pCredential) {
5190 otErr << __FUNCTION__
5191 <<
": While loading keyCredential, failed trying to "
5192 "find expected Master Credential ID: "
5193 << strMasterCredID <<
"\n";
5199 bool bLoaded =
false;
5210 bLoaded = pCredential->LoadSubkey(strID);
5213 auto it_cred = pMapCredentials->find(strID.
Get());
5216 pMapCredentials->end())
5223 otErr << __FUNCTION__
5224 <<
": Expected keyCredential (" << strID
5225 <<
") on map of credentials, but couldn't "
5226 "find it. (Failure.)\n";
5232 it_cred->second.c_str());
5233 if (strSubCredential.Exists())
5234 bLoaded = pCredential->LoadSubkeyFromString(
5235 strSubCredential, strID, pImportPassword);
5242 otErr << __FUNCTION__
5243 <<
": Failed loading keyCredential " << strID
5244 <<
" for master credential " << strMasterCredID
5245 <<
" for Nym " << strNymID <<
".\n";
5250 else if (strNodeName.
Compare(
"subCredential")) {
5251 const OTString strID = xml->getAttributeValue(
"ID");
5252 const OTString strValid = xml->getAttributeValue(
5256 xml->getAttributeValue(
"masterID");
5257 const bool bValid = strValid.
Compare(
"true");
5258 otLog3 <<
"Loading " << (bValid ?
"valid" :
"invalid")
5259 <<
" subCredential ID: " << strID
5260 <<
"\n ...For master credential: " << strMasterCredID
5264 if (
nullptr == pCredential)
5266 if (
nullptr == pCredential) {
5267 otErr << __FUNCTION__
5268 <<
": While loading subCredential, failed trying to "
5269 "find expected Master Credential ID: "
5270 << strMasterCredID <<
"\n";
5276 bool bLoaded =
false;
5287 bLoaded = pCredential->LoadSubcredential(strID);
5290 auto it_cred = pMapCredentials->find(strID.
Get());
5293 pMapCredentials->end())
5300 otErr << __FUNCTION__
5301 <<
": Expected subCredential (" << strID
5302 <<
") on map of credentials, but couldn't "
5303 "find it. (Failure.)\n";
5309 it_cred->second.c_str());
5310 if (strSubCredential.Exists())
5312 pCredential->LoadSubcredentialFromString(
5313 strSubCredential, strID,
5321 otErr << __FUNCTION__
5322 <<
": Failed loading subCredential " << strID
5323 <<
" for master credential " << strMasterCredID
5324 <<
" for Nym " << strNymID <<
".\n";
5329 else if (strNodeName.
Compare(
"requestNum")) {
5331 xml->getAttributeValue(
"serverID");
5333 xml->getAttributeValue(
"currentRequestNum");
5335 otLog3 <<
"\nCurrent Request Number is " << ReqNumCurrent
5336 <<
" for ServerID: " << ReqNumServerID <<
"\n";
5341 m_mapRequestNum[ReqNumServerID.Get()] =
5342 atol(ReqNumCurrent.
Get());
5344 else if (strNodeName.
Compare(
"nymboxHash")) {
5345 const OTString strValue = xml->getAttributeValue(
"value");
5347 otLog3 <<
"\nNymboxHash is: " << strValue <<
"\n";
5349 if (strValue.Exists()) m_NymboxHash.
SetString(strValue);
5351 else if (strNodeName.
Compare(
"nymboxHashItem")) {
5352 const OTString strServerID = xml->getAttributeValue(
"serverID");
5354 xml->getAttributeValue(
"nymboxHash");
5356 otLog3 <<
"\nNymboxHash is " << strNymboxHash
5357 <<
" for ServerID: " << strServerID <<
"\n";
5362 if (strServerID.Exists() && strNymboxHash.
Exists()) {
5364 m_mapNymboxHash[strServerID.Get()] = theID;
5367 else if (strNodeName.
Compare(
"recentHashItem")) {
5368 const OTString strServerID = xml->getAttributeValue(
"serverID");
5370 xml->getAttributeValue(
"recentHash");
5372 otLog3 <<
"\nRecentHash is " << strRecentHash
5373 <<
" for ServerID: " << strServerID <<
"\n";
5378 if (strServerID.Exists() && strRecentHash.
Exists()) {
5380 m_mapRecentHash[strServerID.Get()] = theID;
5383 else if (strNodeName.
Compare(
"inboxHashItem")) {
5385 xml->getAttributeValue(
"accountID");
5387 xml->getAttributeValue(
"hashValue");
5389 otLog3 <<
"\nInboxHash is " << strHashValue
5390 <<
" for Account ID: " << strAccountID <<
"\n";
5396 if (strAccountID.Exists() && strHashValue.
Exists()) {
5398 m_mapInboxHash[strAccountID.Get()] = theID;
5401 else if (strNodeName.
Compare(
"outboxHashItem")) {
5403 xml->getAttributeValue(
"accountID");
5405 xml->getAttributeValue(
"hashValue");
5407 otLog3 <<
"\nOutboxHash is " << strHashValue
5408 <<
" for Account ID: " << strAccountID <<
"\n";
5414 if (strAccountID.Exists() && strHashValue.
Exists()) {
5416 m_mapOutboxHash[strAccountID.Get()] = theID;
5419 else if (strNodeName.
Compare(
"highestTransNum")) {
5421 xml->getAttributeValue(
"serverID");
5423 xml->getAttributeValue(
"mostRecent");
5425 otLog3 <<
"\nHighest Transaction Number ever received is "
5426 << HighNumRecent <<
" for ServerID: " << HighNumServerID
5432 m_mapHighTransNo[HighNumServerID.Get()] =
5433 atol(HighNumRecent.
Get());
5435 else if (strNodeName.
Compare(
"transactionNums")) {
5437 xml->getAttributeValue(
"serverID");
5439 if (!tempServerID.
Exists() ||
5441 otErr << __FUNCTION__
5442 <<
": Error: transactionNums field without value.\n";
5447 if (strTemp.
Exists()) theNumList.Add(strTemp);
5450 while (theNumList.
Peek(lTemp)) {
5453 otLog3 <<
"Transaction Number " << lTemp
5454 <<
" ready-to-use for ServerID: " << tempServerID
5463 else if (strNodeName.
Compare(
"issuedNums")) {
5465 xml->getAttributeValue(
"serverID");
5467 if (!tempServerID.
Exists() ||
5469 otErr << __FUNCTION__
5470 <<
": Error: issuedNums field without value.\n";
5475 if (strTemp.
Exists()) theNumList.Add(strTemp);
5478 while (theNumList.
Peek(lTemp)) {
5481 otLog3 <<
"Currently liable for issued trans# " << lTemp
5482 <<
" at ServerID: " << tempServerID <<
"\n";
5489 else if (strNodeName.
Compare(
"tentativeNums")) {
5491 xml->getAttributeValue(
"serverID");
5493 if (!tempServerID.
Exists() ||
5495 otErr <<
"OTPseudonym::LoadFromString: Error: "
5496 "tentativeNums field without value.\n";
5501 if (strTemp.
Exists()) theNumList.Add(strTemp);
5504 while (theNumList.
Peek(lTemp)) {
5507 otLog3 <<
"Tentative: Currently awaiting success notice, "
5508 "for accepting trans# " << lTemp
5509 <<
" for ServerID: " << tempServerID <<
"\n";
5517 else if (strNodeName.
Compare(
"ackNums")) {
5519 xml->getAttributeValue(
"serverID");
5521 if (!tempServerID.
Exists()) {
5522 otErr << __FUNCTION__
5523 <<
": Error: While loading ackNums "
5524 "field: Missing serverID. Nym contents:\n\n"
5525 << strNym <<
"\n\n";
5536 otErr << __FUNCTION__
5537 <<
": Error: ackNums field without value "
5538 "(at least, unable to LoadEncodedTextField on "
5544 if (strTemp.
Exists()) theNumList.Add(strTemp);
5547 while (theNumList.
Peek(lTemp)) {
5550 otInfo <<
"Acknowledgment record exists for server reply, "
5551 "for Request Number " << lTemp
5552 <<
" for ServerID: " << tempServerID <<
"\n";
5563 else if (strNodeName.
Compare(
"transactionNum")) {
5565 xml->getAttributeValue(
"serverID");
5567 xml->getAttributeValue(
"transactionNum");
5569 otLog3 <<
"Transaction Number " << TransNumAvailable
5570 <<
" available for ServerID: " << TransNumServerID
5575 atol(TransNumAvailable.
Get()));
5579 else if (strNodeName.
Compare(
"issuedNum")) {
5581 xml->getAttributeValue(
"serverID");
5583 xml->getAttributeValue(
"transactionNum");
5585 otLog3 <<
"Currently liable for Transaction Number "
5586 << TransNumAvailable
5587 <<
", for ServerID: " << TransNumServerID <<
"\n";
5590 atol(TransNumAvailable.
Get()));
5596 else if (strNodeName.
Compare(
"tentativeNum")) {
5598 xml->getAttributeValue(
"serverID");
5600 xml->getAttributeValue(
"transactionNum");
5602 otLog3 <<
"Currently waiting on server success notice, "
5603 "accepting Transaction Number " << TransNumAvailable
5604 <<
", for ServerID: " << TransNumServerID <<
"\n";
5607 atol(TransNumAvailable.
Get()));
5614 else if (strNodeName.
Compare(
"acknowledgedNum")) {
5616 xml->getAttributeValue(
"serverID");
5618 xml->getAttributeValue(
"requestNum");
5620 otLog3 <<
"Acknowledgment record exists for server reply, for "
5621 "Request Number " << AckNumValue
5622 <<
", for ServerID: " << AckNumServerID <<
"\n";
5625 atol(AckNumValue.
Get()));
5631 else if (strNodeName.
Compare(
"MARKED_FOR_DELETION")) {
5632 m_bMarkForDeletion =
true;
5633 otLog3 <<
"This nym has been MARKED_FOR_DELETION (at some "
5636 else if (strNodeName.
Compare(
"hasOpenCronItem")) {
5637 OTString strID = xml->getAttributeValue(
"ID");
5640 const int64_t lNewID = atol(strID.
Get());
5641 m_setOpenCronItems.insert(lNewID);
5642 otLog3 <<
"This nym has an open cron item with ID: "
5646 otLog3 <<
"This nym MISSING ID when loading open cron item "
5649 else if (strNodeName.
Compare(
"ownsAssetAcct")) {
5650 OTString strID = xml->getAttributeValue(
"ID");
5653 m_setAccounts.insert(strID.
Get());
5654 otLog3 <<
"This nym has an asset account with the ID: "
5658 otLog3 <<
"This nym MISSING asset account ID when loading "
5661 else if (strNodeName.
Compare(
"mailMessage")) {
5667 if (irr::io::EXN_TEXT == xml->getNodeType()) {
5668 OTString strNodeData = xml->getNodeData();
5678 strNodeData.
At(0, cNewline)) {
5679 if (
'\n' == cNewline)
5680 armorMail.
Set(strNodeData.
Get() +
5685 armorMail.
Set(strNodeData.
Get());
5704 m_dequeMail.push_back(
5713 else if (strNodeName.
Compare(
"outmailMessage")) {
5719 if (irr::io::EXN_TEXT == xml->getNodeType()) {
5720 OTString strNodeData = xml->getNodeData();
5730 strNodeData.
At(0, cNewline)) {
5731 if (
'\n' == cNewline)
5732 armorMail.
Set(strNodeData.
Get() + 1);
5734 armorMail.
Set(strNodeData.
Get());
5746 m_dequeOutmail.push_back(
5755 else if (strNodeName.
Compare(
"outpaymentsMessage")) {
5761 if (irr::io::EXN_TEXT == xml->getNodeType()) {
5762 OTString strNodeData = xml->getNodeData();
5772 strNodeData.
At(0, cNewline)) {
5773 if (
'\n' == cNewline)
5774 armorMail.
Set(strNodeData.
Get() + 1);
5776 armorMail.
Set(strNodeData.
Get());
5788 m_dequeOutpayments.push_back(
5799 otErr <<
"Unknown element type in " << __FUNCTION__ <<
": "
5800 << xml->getNodeName() <<
"\n";
5806 otLog5 <<
"Unknown XML type in " << __FUNCTION__ <<
": "
5807 << xml->getNodeName() <<
"\n";
5827 otWarn << __FUNCTION__ <<
": Failed loading a signed nymfile: " << nymID
5837 otErr << __FUNCTION__ <<
": Failed verifying nymfile: " << nymID
5843 otErr << __FUNCTION__
5844 <<
": Failed verifying signature on nymfile: " << nymID
5845 <<
"\n Signer Nym ID: " << strSignerNymID <<
"\n";
5853 <<
"Loaded and verified signed nymfile. Reading from string...\n";
5859 const int64_t lLength =
5862 otErr << __FUNCTION__ <<
": Bad length (" << lLength
5863 <<
") while loading nymfile: " << nymID <<
"\n";
5881 otInfo <<
"Saving nym to: " << m_strNymfile <<
"\n";
5892 const bool bSaved = theNymfile.
SaveFile();
5897 otErr << __FUNCTION__
5898 <<
": Failed while calling theNymfile.SaveFile() for Nym "
5899 << strNymID <<
" using Signer Nym " << strSignerNymID <<
"\n";
5907 otErr << __FUNCTION__
5908 <<
": Failed trying to sign and save Nymfile for Nym " << strNymID
5909 <<
" using Signer Nym " << strSignerNymID <<
"\n";
5919 int64_t lTransactionNumber = 0;
5921 int32_t nNumberOfTransactionNumbers1 = 0;
5922 int32_t nNumberOfTransactionNumbers2 = 0;
5924 std::string strServerID;
5933 if (!(pDeque->empty())) {
5934 nNumberOfTransactionNumbers1 +=
5935 static_cast<int32_t
>(pDeque->size());
5944 strServerID = it.first;
5948 OTString OTstrServerID = strServerID.c_str();
5950 if (!(pDeque->empty())) {
5951 for (uint32_t i = 0; i < pDeque->size(); i++) {
5952 lTransactionNumber = pDeque->at(i);
5956 nNumberOfTransactionNumbers2++;
5960 otOut <<
"OTPseudonym::" << __FUNCTION__
5961 <<
": Issued transaction # " << lTransactionNumber
5962 <<
" from THE_NYM not found on *this.\n";
5972 if (nNumberOfTransactionNumbers1 != nNumberOfTransactionNumbers2) {
5973 otOut <<
"OTPseudonym::" << __FUNCTION__
5974 <<
": Issued transaction # Count mismatch: "
5975 << nNumberOfTransactionNumbers1 <<
" and "
5976 << nNumberOfTransactionNumbers2 <<
"\n";
6006 int64_t lTransactionNumber = 0;
6008 std::string strServerID;
6014 strServerID = it.first;
6017 OTString OTstrServerID = strServerID.c_str();
6021 if (!(pDeque->empty())) {
6022 for (uint32_t i = 0; i < pDeque->size(); i++) {
6023 lTransactionNumber = pDeque->at(i);
6027 lTransactionNumber)) {
6028 otOut <<
"OTPseudonym::" << __FUNCTION__
6029 <<
": Issued transaction # " << lTransactionNumber
6030 <<
" from *this not found on THE_NYM.\n";
6068 const char* szTheFilename = strID.
Get();
6073 if (
nullptr == szFilename) {
6074 m_strNymfile = szTheFilename;
6077 m_strNymfile = szFilename;
6081 otErr << __FUNCTION__ <<
": File does not exist: " << szFoldername
6087 szFoldername, m_strNymfile.
Get()));
6089 if (strFileContents.length() < 2) {
6090 otErr << __FUNCTION__ <<
": Error reading file: " << szFoldername
6095 OTString strRawFile = strFileContents.c_str();
6108 if (!strInput.
Exists()) {
6110 otErr << __FUNCTION__ <<
": strInput does not exist. (Returning "
6111 "false.) ID currently set to: " << strID
6133 if (
nullptr == pPWData) pPWData = &thePWData;
6146 auto it = m_mapCredentials.begin();
6147 OT_ASSERT(m_mapCredentials.end() != it);
6153 if (const_cast<OTKeypair&>(
6154 pCredential->GetSignKeypair(&m_listRevokedIDs))
6155 .SaveCertAndPrivateKeyToString(strPubAndPrivCert, &strReason,
6157 const bool bReturnValue =
6159 strPubAndPrivCert, &strReason, pImportPassword);
6162 otErr << __FUNCTION__
6163 <<
": Failed in call to m_pkeypair->SetPrivateKey.\n";
6165 return bReturnValue;
6174 std::string strFilename = strID.
Get();
6176 if (strFoldername.empty()) {
6177 otErr << __FUNCTION__ <<
": Error: strFoldername is empty!";
6180 if (strFilename.empty()) {
6181 otErr << __FUNCTION__ <<
": Error: strFilename is empty!";
6185 const bool bExists =
OTDB::Exists(strFoldername, strFilename);
6189 "%s: (%s: is %s). File does not exist: %s in: %s\n",
6190 __FUNCTION__,
"bChecking", bChecking ?
"true" :
"false",
6191 strFoldername.c_str(), strFilename.c_str());
6198 &strReason, pImportPassword))
6202 otErr << __FUNCTION__ <<
": Failure, filename: " << strFoldername
6211 strCredListFile.
Format(
"%s.cred", strNymID.
Get());
6216 strCredListFile.
Get());
6288 if (!m_mapCredentials.empty()) {
6291 for (
const auto& it : m_mapCredentials) {
6300 pCredential = it.second;
6301 if (
nullptr != pCredential)
break;
6303 if (
nullptr == pCredential)
OT_FAIL;
6310 otWarn << __FUNCTION__ <<
": This nym (" << strNymID
6311 <<
") has no credentials from where I can pluck a private "
6312 "AUTHENTICATION key, apparently."
6313 " Instead, using the private key on the Nym's keypair (a "
6314 "system which is being deprecated in favor of credentials,"
6315 " so it's not good that I'm having to do this here. Why are "
6316 "there no credentials on this Nym?)\n";
6329 if (!m_mapCredentials.empty()) {
6332 for (
const auto& it : m_mapCredentials) {
6341 pCredential = it.second;
6342 if (
nullptr != pCredential)
break;
6344 if (
nullptr == pCredential)
OT_FAIL;
6352 otWarn << __FUNCTION__ <<
": This nym (" << strNymID
6353 <<
") has no credentials from where I can pluck a private "
6354 "ENCRYPTION key, apparently. "
6355 "Instead, using the private key on the Nym's keypair (a "
6356 "system which is being deprecated in favor of credentials, "
6357 "so it's not good that I'm having to do this here. Why are "
6358 "there no credentials on this Nym?)\n";
6371 if (!m_mapCredentials.empty()) {
6374 for (
const auto& it : m_mapCredentials) {
6383 pCredential = it.second;
6384 if (
nullptr != pCredential)
break;
6386 if (
nullptr == pCredential)
OT_FAIL;
6393 otWarn << __FUNCTION__ <<
": This nym (" << strNymID
6394 <<
") has no credentials from where I can pluck a private "
6395 "SIGNING key, apparently. Instead,"
6396 " using the private key on the Nym's keypair (a system which "
6397 "is being deprecated in favor of credentials, so it's not "
6399 " that I'm having to do this here. Why are there no "
6400 "credentials on this Nym?)\n";
6413 if (!m_mapCredentials.empty()) {
6416 for (
const auto& it : m_mapCredentials) {
6425 pCredential = it.second;
6426 if (
nullptr != pCredential)
break;
6428 if (
nullptr == pCredential)
OT_FAIL;
6435 otWarn << __FUNCTION__ <<
": This nym (" << strNymID
6436 <<
") has no credentials from which I can pluck a public "
6437 "AUTHENTICATION key, unfortunately. Instead,"
6438 " using the public key on the Nym's keypair (a system which "
6439 "is being deprecated in favor of credentials, so it's not "
6441 " that I'm having to do this here. Why are there no "
6442 "credentials on this Nym?)\n";
6455 if (!m_mapCredentials.empty()) {
6457 for (
const auto& it : m_mapCredentials) {
6466 pCredential = it.second;
6467 if (
nullptr != pCredential)
break;
6469 if (
nullptr == pCredential)
OT_FAIL;
6476 otWarn << __FUNCTION__ <<
": This nym (" << strNymID
6477 <<
") has no credentials from which I can pluck a public "
6478 "ENCRYPTION key, unfortunately. Instead,"
6479 " using the public key on the Nym's keypair (a system which "
6480 "is being deprecated in favor of credentials, so it's not "
6482 " that I'm having to do this here. Why are there no "
6483 "credentials on this Nym?)\n";
6496 if (!m_mapCredentials.empty()) {
6499 for (
const auto& it : m_mapCredentials) {
6508 pCredential = it.second;
6509 if (
nullptr != pCredential)
break;
6511 if (
nullptr == pCredential)
OT_FAIL;
6518 otWarn << __FUNCTION__ <<
": This nym (" << strNymID
6519 <<
") has no credentials from which I can pluck a public "
6520 "SIGNING key, unfortunately. Instead,"
6521 " using the public key on the Nym's keypair (a system which "
6522 "is being deprecated in favor of credentials, so it's not "
6524 " that I'm having to do this here. Why are there no "
6525 "credentials on this Nym?)\n";
6550 char cKeyType)
const
6558 for (
const auto& it : m_mapCredentials) {
6563 listOutput, theSignature, cKeyType);
6564 nCount += nTempCount;
6573 m_nymID = theIdentifier;
6579 theIdentifier = m_nymID;
6595 : m_bMarkForDeletion(false)
6597 , m_lUsageCredits(0)
6606 m_strVersion =
"1.0";
6611 : m_bMarkForDeletion(false)
6613 , m_lUsageCredits(0)
6620 m_strNymfile = filename;
6626 : m_bMarkForDeletion(false)
6628 , m_lUsageCredits(0)
6638 : m_bMarkForDeletion(false)
6640 , m_lUsageCredits(0)
6651 m_listRevokedIDs.clear();
6653 while (!m_mapCredentials.empty()) {
6654 OTCredential* pCredential = m_mapCredentials.begin()->second;
6655 m_mapCredentials.erase(m_mapCredentials.begin());
6657 pCredential =
nullptr;
6660 while (!m_mapRevoked.empty()) {
6661 OTCredential* pCredential = m_mapRevoked.begin()->second;
6662 m_mapRevoked.erase(m_mapRevoked.begin());
6664 pCredential =
nullptr;
6670 m_mapRequestNum.clear();
6671 m_mapHighTransNo.clear();
6679 m_mapNymboxHash.clear();
6680 m_mapRecentHash.clear();
6681 m_mapInboxHash.clear();
6682 m_mapOutboxHash.clear();
6684 m_setAccounts.clear();
6685 m_setOpenCronItems.clear();
6709 if (
nullptr != m_pkeypair)
delete m_pkeypair;
6711 m_pkeypair =
nullptr;
static EXPORT void vError(const char *szError,...)
EXPORT bool LoadCertAndPrivateKeyFromString(const OTString &strInput, const OTString *pstrReason=nullptr, const OTPassword *pImportPassword=nullptr)
EXPORT int32_t GetIssuedNumCount(const OTIdentifier &theServerID) const
EXPORT bool SetPrivateKey(const OTString &strKey, bool bEscaped=true)
EXPORT bool StorePlainString(std::string strContents, std::string strFolder, std::string oneStr="", std::string twoStr="", std::string threeStr="")
OTLOG_IMPORT OTLogStream otLog4
EXPORT void GetPublicCredentials(OTString &strCredList, OTString::Map *pmapCredFiles=nullptr) const
std::map< std::string, std::string > Map
EXPORT bool SetNymboxHash(const std::string &server_id, const OTIdentifier &theInput)
EXPORT const OTAsymmetricKey & GetPublicSignKey(const OTString::List *plistRevokedIDs=nullptr) const
EXPORT bool VerifyIssuedNumbersOnNym(OTPseudonym &THE_NYM)
static EXPORT OTPseudonym * LoadPublicNym(const OTIdentifier &NYM_ID, const OTString *pstrName=nullptr, const char *szFuncName=nullptr)
EXPORT bool SetPublicKey(const OTString &strKey, bool bEscaped=true)
std::list< OTAsymmetricKey * > listOfAsymmetricKeys
EXPORT const OTAsymmetricKey & GetPublicKey() const
EXPORT const char * GetDisplayString() const
EXPORT const OTSubcredential * GetSubcredential(const OTString &strSubID, const OTString::List *plistRevokedIDs=nullptr) const
EXPORT bool CalculateNymboxHash(OTIdentifier &theOutput)
EXPORT void HarvestTransactionNumbers(const OTIdentifier &theServerID, OTPseudonym &SIGNER_NYM, OTPseudonym &theOtherNym, bool bSave=true)
EXPORT const OTSubcredential * GetSubcredential(const OTString &strMasterID, const OTString &strSubCredID) const
static EXPORT bool DoesCertfileExist(const OTString &strNymID)
EXPORT const OTString & GetNymID() const
EXPORT bool CalculateDigest(const OTData &dataInput)
EXPORT OTItem * GenerateTransactionStatement(const OTTransaction &theOwner)
EXPORT bool ClawbackTransactionNumber(const OTIdentifier &theServerID, const int64_t &lTransClawback, bool bSave=false, OTPseudonym *pSIGNER_NYM=nullptr)
EXPORT bool LoadFromString(const OTString &strNym, OTString::Map *pMapCredentials=nullptr, OTString *pstrReason=nullptr, const OTPassword *pImportPassword=nullptr)
EXPORT bool SetInboxHash(const std::string &acct_id, const OTIdentifier &theInput)
EXPORT void GetIdentifier(OTIdentifier &theIdentifier) const
static EXPORT const OTString & Pubcred()
EXPORT OTString & GetFilePayload()
#define WIPE_MAP_AND_DEQUE(the_map)
EXPORT OTCredential * GetMasterCredential(const OTString &strID)
EXPORT bool SavePublicKey(const OTString &strPath) const
EXPORT bool SaveContract()
EXPORT const OTAsymmetricKey & GetPrivateAuthKey(const OTString::List *plistRevokedIDs=nullptr) const
virtual bool VerifyInternally()
EXPORT void GetFilename(OTString &strFilename) const
EXPORT bool VerifyIssuedNum(const OTString &strServerID, const int64_t &lTransNum) const
EXPORT void AddOutmail(OTMessage &theMessage)
static EXPORT const char * PathSeparator()
EXPORT bool AddNewSubkey(int32_t nBits=1024, const OTString::Map *pmapPrivate=nullptr, const OTPasswordData *pPWData=nullptr, OTSubkey **ppSubkey=nullptr)
static EXPORT const OTString & Pubkey()
EXPORT bool SaveAndReloadBothKeysFromTempFile(OTString *pstrOutputCert=nullptr, const OTString *pstrReason=nullptr, const OTPassword *pImportPassword=nullptr)
EXPORT bool GetNextTransactionNum(OTPseudonym &SIGNER_NYM, const OTString &strServerID, int64_t &lTransNum, bool bSave=true)
EXPORT bool VerifyTentativeNum(const OTString &strServerID, const int64_t &lTransNum) const
static EXPORT const OTString & Nym()
EXPORT bool SetCertificate(const OTString &strCert, bool bEscaped=true)
EXPORT bool RemoveOutmailByIndex(int32_t nIndex)
EXPORT bool SavePseudonymWallet(OTString &strOutput) const
EXPORT const OTAsymmetricKey & GetPublicEncrKey() const
EXPORT bool LoadBothKeysFromCertFile(const OTString &strFoldername, const OTString &strFilename, const OTString *pstrReason=nullptr, const OTPassword *pImportPassword=nullptr)
EXPORT int64_t GetTransactionNum(const OTIdentifier &theServerID, int32_t nIndex) const
EXPORT bool GetInboxHash(const std::string &acct_id, OTIdentifier &theOutput) const
EXPORT void GetPrivateCredentials(OTString &strCredList, OTString::Map *pmapCredFiles=nullptr)
OTLOG_IMPORT OTLogStream otOut
EXPORT bool HasPublicKey()
EXPORT bool Server_PubKeyExists(OTString *pstrID=nullptr)
std::map< std::string, OTIdentifier > mapOfIdentifiers
EXPORT bool RemoveGenericNum(mapOfTransNums &THE_MAP, OTPseudonym &SIGNER_NYM, const OTString &strServerID, const int64_t &lTransNum)
EXPORT bool ReEncryptPrivateCredentials(bool bImporting, const OTPasswordData *pPWData=nullptr, const OTPassword *pImportPassword=nullptr)
OTLOG_IMPORT OTLogStream otLog3
bool RemoveTentativeNum(OTPseudonym &SIGNER_NYM, const OTString &strServerID, const int64_t &lTransNum, bool bSave)
EXPORT void SetAttachment(const OTString &theStr)
EXPORT void AddOutpayments(OTMessage &theMessage)
EXPORT bool Peek(int64_t &lPeek) const
EXPORT uint32_t GetLength() const
EXPORT bool GetRecentHash(const std::string &server_id, OTIdentifier &theOutput) const
EXPORT bool AddTentativeNum(const OTString &strServerID, const int64_t &lTransNum)
EXPORT bool AddNewSubkey(const OTIdentifier &idMasterCredential, int32_t nBits=1024, const OTString::Map *pmapPrivate=nullptr, const OTPasswordData *pPWData=nullptr, OTString *pstrNewID=nullptr)
EXPORT bool LoadSignedNymfile(OTPseudonym &SIGNER_NYM)
EXPORT void SerializeNymIDSource(OTString &strOutput) const
EXPORT void Concatenate(const char *arg,...)
EXPORT void SetNymboxHashServerSide(const OTIdentifier &theInput)
EXPORT bool WriteArmoredString(OTString &strOutput, const std::string str_type, bool bEscaped=false) const
EXPORT int32_t GetTransactionNumCount(const OTIdentifier &theServerID) const
static OTCredential * CreateMaster(const OTString &strSourceForNymID, int32_t nBits=1024, const OTString::Map *pmapPrivate=nullptr, const OTString::Map *pmapPublic=nullptr, const OTPasswordData *pPWData=nullptr)
EXPORT bool ReEncryptPrivateCredentials(const OTPassword &theExportPassword, bool bImporting)
EXPORT void HarvestIssuedNumbers(const OTIdentifier &theServerID, OTPseudonym &SIGNER_NYM, OTPseudonym &theOtherNym, bool bSave=false)
EXPORT bool VerifyPseudonym() const
static EXPORT OTItem * CreateItemFromTransaction(const OTTransaction &theOwner, OTItem::itemType theType, const OTIdentifier *pDestinationAcctID=nullptr)
static OTCredential * LoadMaster(const OTString &strNymID, const OTString &strMasterCredID, const OTPasswordData *pPWData=nullptr)
EXPORT bool DecodeIfArmored(bool escapedIsAllowed=true)
EXPORT bool Exists() const
EXPORT bool SetString(const OTString &theData, bool bLineBreaks=true)
EXPORT int64_t GetGenericNum(const mapOfTransNums &THE_MAP, const OTIdentifier &theServerID, int32_t nIndex) const
std::map< std::string, dequeOfTransNums * > mapOfTransNums
EXPORT void SetString(const char *szString)
EXPORT void SetIdentifier(const OTIdentifier &theIdentifier)
EXPORT int32_t GetMailCount() const
return the number of mail items available for this Nym.
EXPORT const OTCredential * GetRevokedCredentialByIndex(int32_t nIndex) const
EXPORT void ClearOutpayments()
EXPORT bool SetPublicKey(const OTASCIIArmor &strKey)
EXPORT void Format(const char *fmt,...)
EXPORT bool AddNewSubcredential(const OTString::Map &mapPrivate, const OTString::Map &mapPublic, const OTPasswordData *pPWData=nullptr, OTSubcredential **ppSubcred=nullptr)
EXPORT int32_t GetOutpaymentsCount() const
return the number of payments items available for this Nym.
EXPORT bool LoadPublicKey()
EXPORT bool Savex509CertAndPrivateKeyToString(OTString &strOutput, const OTString *pstrReason=nullptr)
EXPORT void ClearOutmail()
static EXPORT const OTString & Credential()
static EXPORT OTPassword * GetPassphraseFromUser(const OTString *pstrDisplay=nullptr, bool bAskTwice=false)
EXPORT bool Compare(const char *compare) const
EXPORT bool GetHighestNum(const OTString &strServerID, int64_t &lHighestNum) const
EXPORT int32_t GetTentativeNumCount(const OTIdentifier &theServerID) const
EXPORT bool RemoveTransactionNum(OTPseudonym &SIGNER_NYM, const OTString &strServerID, const int64_t &lTransNum)
const OTIdentifier & GetPurportedServerID() const
EXPORT const OTString & GetMasterCredID() const
#define CLEAR_MAP_AND_DEQUE(the_map)
EXPORT void Set(const char *data, uint32_t enforcedMaxLength=0)
EXPORT bool VerifyTransactionStatementNumbersOnNym(OTPseudonym &THE_NYM)
EXPORT bool GenerateNym(int32_t nBits=1024, bool bCreateFile=true, std::string str_id_source="", std::string str_alt_location="")
EXPORT bool Loadx509CertAndPrivateKey(bool bChecking=false, const OTPasswordData *pPWData=nullptr, const OTPassword *pImportPassword=nullptr)
EXPORT void SaveCredentialListToString(OTString &strOutput)
EXPORT bool AddTransactionNum(OTPseudonym &SIGNER_NYM, const OTString &strServerID, int64_t lTransNum, bool bSave)
EXPORT void SaveCredentialsToString(OTString &strOutput, OTString::Map *pmapPubInfo=nullptr, OTString::Map *pmapPriInfo=nullptr)
EXPORT bool CalculateID(OTIdentifier &theOutput) const
EXPORT std::string QueryPlainString(std::string strFolder, std::string oneStr="", std::string twoStr="", std::string threeStr="")
EXPORT int64_t GetTentativeNum(const OTIdentifier &theServerID, int32_t nIndex) const
static EXPORT bool LoadEncodedTextField(irr::io::IrrXMLReader *&xml, OTASCIIArmor &ascOutput)
EXPORT const OTAsymmetricKey & GetPublicAuthKey() const
virtual bool VerifyInternally()
EXPORT bool SetIdentifierByPubkey()
EXPORT bool Output(std::set< int64_t > &theOutput) const
EXPORT bool GetCurrentRequestNum(const OTString &strServerID, int64_t &lReqNum) const
EXPORT int64_t UpdateHighestNum(OTPseudonym &SIGNER_NYM, const OTString &strServerID, std::set< int64_t > &setNumbers, std::set< int64_t > &setOutputGood, std::set< int64_t > &setOutputBad, bool bSave=false)
EXPORT bool RemoveIssuedNum(OTPseudonym &SIGNER_NYM, const OTString &strServerID, const int64_t &lTransNum, bool bSave)
EXPORT int32_t GetPublicKeysBySignature(listOfAsymmetricKeys &listOutput, const OTSignature &theSignature, char cKeyType= '0') const
std::deque< int64_t > dequeOfTransNums
EXPORT bool VerifyGenericNum(const mapOfTransNums &THE_MAP, const OTString &strServerID, const int64_t &lTransNum) const
const OTAsymmetricKey & GetPrivateAuthKey() const
EXPORT void SetNymIDSource(const OTString &strSource)
const OTAsymmetricKey & GetPrivateEncrKey() const
EXPORT int32_t GetOutmailCount() const
return the number of mail items available for this Nym.
EXPORT OTMessage * GetOutmailByIndex(int32_t nIndex) const
EXPORT void ReleaseTransactionNumbers()
EXPORT bool AddNewSubcredential(const OTIdentifier &idMasterCredential, const OTString::Map *pmapPrivate=nullptr, const OTString::Map *pmapPublic=nullptr, const OTPasswordData *pPWData=nullptr)
static OTCredential * LoadMasterFromString(const OTString &strInput, const OTString &strNymID, const OTString &strMasterCredID, OTPasswordData *pPWData=nullptr, const OTPassword *pImportPassword=nullptr)
EXPORT bool RemoveMailByIndex(int32_t nIndex)
EXPORT bool SetOutboxHash(const std::string &acct_id, const OTIdentifier &theInput)
EXPORT bool HasPublicKey()
EXPORT bool AddAcknowledgedNum(const OTString &strServerID, const int64_t &lRequestNum)
#define OT_ASSERT_MSG(x, s)
EXPORT bool RemoveAcknowledgedNum(OTPseudonym &SIGNER_NYM, const OTString &strServerID, const int64_t &lRequestNum, bool bSave)
EXPORT void SetAltLocation(const OTString &strLocation)
mapOfTransNums & GetMapIssuedNum()
OTLOG_IMPORT OTLogStream otInfo
EXPORT bool CompareID(const OTIdentifier &theIdentifier) const
EXPORT bool LoadPublicKeyFromCertString(const OTString &strCert, bool bEscaped=true, const OTString *pstrReason=nullptr, const OTPassword *pImportPassword=nullptr)
static EXPORT OTPseudonym * LoadPrivateNym(const OTIdentifier &NYM_ID, bool bChecking=false, const OTString *pstrName=nullptr, const char *szFuncName=nullptr, const OTPasswordData *pPWData=nullptr, const OTPassword *pImportPassword=nullptr)
EXPORT int32_t Count() const
EXPORT bool IsRegisteredAtServer(const OTString &strServerID) const
EXPORT const OTAsymmetricKey & GetPrivateKey() const
virtual EXPORT void GetIdentifier(OTIdentifier &theIdentifier) const
EXPORT bool AddGenericNum(mapOfTransNums &THE_MAP, const OTString &strServerID, int64_t lTransNum)
EXPORT const OTAsymmetricKey & GetPublicAuthKey(const OTString::List *plistRevokedIDs=nullptr) const
EXPORT OTCredential * GetRevokedCredential(const OTString &strID)
EXPORT bool SetRecentHash(const std::string &server_id, const OTIdentifier &theInput)
EXPORT bool At(uint32_t index, char &c) const
virtual EXPORT ~OTPseudonym()
EXPORT const OTAsymmetricKey & GetPublicSignKey() const
EXPORT bool GetNymboxHash(const std::string &server_id, OTIdentifier &theOutput) const
EXPORT bool Loadx509CertAndPrivateKeyFromString(const OTString &strInput, const OTPasswordData *pPWData=nullptr, const OTPassword *pImportPassword=nullptr)
EXPORT int64_t GetReferenceToNum() const
EXPORT bool GetOutboxHash(const std::string &acct_id, OTIdentifier &theOutput) const
EXPORT size_t GetSubcredentialCount() const
EXPORT bool HasPrivateKey()
OTLOG_IMPORT OTLogStream otWarn
EXPORT int32_t GetGenericNumCount(const mapOfTransNums &THE_MAP, const OTIdentifier &theServerID) const
EXPORT bool SavePseudonym()
EXPORT int32_t GetAcknowledgedNumCount(const OTIdentifier &theServerID) const
EXPORT const char * Get() const
virtual EXPORT bool SignContract(const OTPseudonym &theNym, const OTPasswordData *pPWData=nullptr)
transactionType GetType() const
EXPORT const OTAsymmetricKey & GetPublicEncrKey(const OTString::List *plistRevokedIDs=nullptr) const
OTLOG_IMPORT OTLogStream otErr
EXPORT const OTString & GetSourceForNymID() const
EXPORT int64_t GetTransactionNum() const
EXPORT void DisplayStatistics(OTString &strOutput)
EXPORT bool SetPrivateKey(const OTString &strKey, bool bEscaped=false)
EXPORT void OnUpdateRequestNum(OTPseudonym &SIGNER_NYM, const OTString &strServerID, int64_t lNewRequestNumber)
EXPORT const OTCredential * GetMasterCredentialByIndex(int32_t nIndex) const
EXPORT bool GetNymboxHashServerSide(const OTIdentifier &theServerID, OTIdentifier &theOutput)
EXPORT size_t GetRevokedCredentialCount() const
EXPORT const OTMasterkey & GetMasterkey() const
EXPORT bool HasPrivateKey()
EXPORT bool SaveCertAndPrivateKeyToString(OTString &strOutput, const OTString *pstrReason=nullptr, const OTPassword *pImportPassword=nullptr)
EXPORT bool RemoveOutpaymentsByIndex(int32_t nIndex, bool bDeleteIt=true)
EXPORT void RemoveReqNumbers(const OTString *pstrServerID=nullptr)
EXPORT void AddMail(OTMessage &theMessage)
EXPORT void GetString(OTString &theStr) const
virtual EXPORT bool VerifySignature(const OTPseudonym &theNym, const OTPasswordData *pPWData=nullptr) const
EXPORT bool Exists(std::string strFolder, std::string oneStr="", std::string twoStr="", std::string threeStr="")
EXPORT bool LoadPublicKey(const OTString &strFoldername, const OTString &strFilename)
EXPORT bool SaveCredentialList()
EXPORT bool ResyncWithServer(const OTLedger &theNymbox, const OTPseudonym &theMessageNym)
EXPORT int64_t GetAcknowledgedNum(const OTIdentifier &theServerID, int32_t nIndex) const
static EXPORT const OTString & Cert()
EXPORT bool IsEmpty() const
const OTAsymmetricKey & GetPrivateSignKey() const
const OTIdentifier & GetUserID() const
EXPORT bool CertfileExists()
EXPORT bool GetString(OTString &theData, bool bLineBreaks=true) const
EXPORT bool LoadContractFromString(const OTString &theStr)
EXPORT void RemoveAllNumbers(const OTString *pstrServerID=nullptr, bool bRemoveHighestNum=true)
EXPORT const OTAsymmetricKey & GetPrivateEncrKey(const OTString::List *plistRevokedIDs=nullptr) const
EXPORT const OTAsymmetricKey & GetPrivateSignKey(const OTString::List *plistRevokedIDs=nullptr) const
EXPORT void SerializeIDs(OTString &strOutput, const OTString::List &listRevokedIDs, OTString::Map *pmapPubInfo=nullptr, OTString::Map *pmapPriInfo=nullptr, bool bShowRevoked=false, bool bValid=true) const
EXPORT bool LoadCredentials(bool bLoadPrivate=false, const OTPasswordData *pPWData=nullptr, const OTPassword *pImportPassword=nullptr)
EXPORT int64_t GetIssuedNum(const OTIdentifier &theServerID, int32_t nIndex) const
EXPORT const OTSubcredential * GetRevokedSubcred(const OTString &strRevokedID, const OTString &strSubCredID) const
EXPORT bool Savex509CertAndPrivateKey(bool bCreateFile=true, const OTString *pstrReason=nullptr)
EXPORT bool VerifyAgainstSource() const
EXPORT OTMessage * GetOutpaymentsByIndex(int32_t nIndex) const
EXPORT size_t GetMasterCredentialCount() const
EXPORT bool VerifyInternally() const
EXPORT bool MakeNewKeypair(int32_t nBits=1024)
std::map< std::string, OTCredential * > mapOfCredentials
EXPORT bool AddIssuedNum(const OTString &strServerID, const int64_t &lTransNum)
EXPORT bool AddNewMasterCredential(OTString &strOutputMasterCredID, const OTString *pstrSourceForNymID=nullptr, int32_t nBits=1024, const OTString::Map *pmapPrivate=nullptr, const OTString::Map *pmapPublic=nullptr, const OTPasswordData *pPWData=nullptr, bool bChangeNymID=false)
static EXPORT void vOutput(int32_t nVerbosity, const char *szOutput,...)
virtual EXPORT void Release()
EXPORT bool VerifyAcknowledgedNum(const OTString &strServerID, const int64_t &lRequestNum) const
void WriteToFile(std::ostream &ofs) const
EXPORT const std::string GetSubcredentialIDByIndex(size_t nIndex) const
const OTIdentifier & GetRealServerID() const
EXPORT bool UnRegisterAtServer(const OTString &strServerID)
EXPORT OTMessage * GetMailByIndex(int32_t nIndex) const
EXPORT bool VerifyTransactionNum(const OTString &strServerID, const int64_t &lTransNum) const
EXPORT bool SaveSignedNymfile(OTPseudonym &SIGNER_NYM)
EXPORT bool LoadNymfile(const char *szFilename=nullptr)
EXPORT int32_t GetPublicKeysBySignature(listOfAsymmetricKeys &listOutput, const OTSignature &theSignature, char cKeyType= '0') const
EXPORT void IncrementRequestNum(OTPseudonym &SIGNER_NYM, const OTString &strServerID)
OTLOG_IMPORT OTLogStream otLog5
EXPORT const mapOfTransactions & GetTransactionMap() const