本文整理汇总了C++中OTPseudonym::LoadSignedNymfile方法的典型用法代码示例。如果您正苦于以下问题:C++ OTPseudonym::LoadSignedNymfile方法的具体用法?C++ OTPseudonym::LoadSignedNymfile怎么用?C++ OTPseudonym::LoadSignedNymfile使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OTPseudonym
的用法示例。
在下文中一共展示了OTPseudonym::LoadSignedNymfile方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: onFinalReceipt
// This is called by OTCronItem::HookRemovalFromCron
// (After calling this method, HookRemovalFromCron then calls onRemovalFromCron.)
//
void OTAgreement::onFinalReceipt(OTCronItem & theOrigCronItem,
const long & lNewTransactionNumber,
OTPseudonym & theOriginator,
OTPseudonym * pRemover)
{
OTCron * pCron = GetCron();
OT_ASSERT(NULL != pCron);
OTPseudonym * pServerNym = pCron->GetServerNym();
OT_ASSERT(NULL != pServerNym);
// -------------------------------------------------
// The finalReceipt Item's ATTACHMENT contains the UPDATED Cron Item.
// (With the SERVER's signature on it!)
//
OTString strUpdatedCronItem(*this);
OTString * pstrAttachment=&strUpdatedCronItem;
const OTString strOrigCronItem(theOrigCronItem);
// -----------------------------------------------------------------
OTPseudonym theRecipientNym; // Don't use this... use the pointer just below.
// The Nym who is actively requesting to remove a cron item will be passed in as pRemover.
// However, sometimes there is no Nym... perhaps it just expired and pRemover is NULL.
// The originating Nym (if different than remover) is loaded up. Otherwise the originator
// pointer just pointers to *pRemover.
//
OTPseudonym * pRecipient = NULL;
if (pServerNym->CompareID(this->GetRecipientUserID()))
{
pRecipient = pServerNym; // Just in case the recipient Nym is also the server Nym.
}
// *******************************************************
//
// If pRemover is NOT NULL, and he has the Recipient's ID...
// then set the pointer accordingly.
//
else if ((NULL != pRemover) && (true == pRemover->CompareID(this->GetRecipientUserID())))
{
pRecipient = pRemover; // <======== now both pointers are set (to same Nym). DONE!
}
// --------------------------------------------------------------------------------------------------
if (NULL == pRecipient)
{
// GetSenderUserID() should be the same on THIS (updated version of the same cron item)
// but for whatever reason, I'm checking the userID on the original version. Sue me.
//
const OTIdentifier NYM_ID(this->GetRecipientUserID());
theRecipientNym.SetIdentifier(NYM_ID);
if (false == theRecipientNym.LoadPublicKey())
{
OTString strNymID(NYM_ID);
OTLog::vError("OTAgreement::onFinalReceipt: Failure loading Recipient's public key:\n%s\n", strNymID.Get());
}
else if (theRecipientNym.VerifyPseudonym() &&
theRecipientNym.LoadSignedNymfile(*pServerNym)) // ServerNym here is merely the signer on this file.
{
pRecipient = &theRecipientNym; // <=====
}
else
{
OTString strNymID(NYM_ID);
OTLog::vError("OTAgreement::onFinalReceipt: Failure verifying Recipient's public key or loading signed nymfile: %s\n",
strNymID.Get());
}
}
// -------------------------------
// First, we are closing the transaction number ITSELF, of this cron item,
// as an active issued number on the originating nym. (Changing it to CLOSED.)
//
// Second, we're verifying the CLOSING number, and using it as the closing number
// on the FINAL RECEIPT (with that receipt being "InReferenceTo" this->GetTransactionNum())
//
const long lRecipientOpeningNumber = this->GetRecipientOpeningNum();
const long lRecipientClosingNumber = this->GetRecipientClosingNum();
// -----------------------------------------------------------------------------------
const long lSenderOpeningNumber = theOrigCronItem.GetTransactionNum();
const long lSenderClosingNumber = (theOrigCronItem.GetCountClosingNumbers() > 0) ?
theOrigCronItem.GetClosingTransactionNoAt(0) : 0; // index 0 is closing number for sender, since GetTransactionNum() is his opening #.
// ----------------------------------
const OTString strServerID(GetServerID());
// -----------------------------------------------------------------
//
//.........这里部分代码省略.........