示例#1
0
void CAuthenticationProfileImpl::sendTrustListUID(const iviLink::BaseUid uid)
{
   LOG4CPLUS_TRACE_METHOD(msLogger, __PRETTY_FUNCTION__ );
   LOG4CPLUS_INFO(msLogger, "uid = " + uid.value());
   UInt8* outgoingData = new UInt8[uid.value().length() + 1];
   outgoingData[0] = static_cast<UInt8>(SEND_UID);
   memcpy(outgoingData + 1, (void*)const_cast<char*>(uid.value().c_str()), uid.value().length() + 1);
   iviLink::Channel::sendBuffer(mChannelID, outgoingData, uid.value().length() + 1);
   delete[] outgoingData;
}
void CAuthenticationProfileImpl::sendTrustListUidAndName(const iviLink::BaseUid uid, const std::string name)
{
   LOG4CPLUS_TRACE_METHOD(msLogger, __PRETTY_FUNCTION__ );
   LOG4CPLUS_INFO(msLogger, "uid = " + uid.value());
   LOG4CPLUS_INFO(msLogger, "name = " + name);

   UInt32 size = 1;
   size += iviLink::stringInBufSize(uid.value());
   size += iviLink::stringInBufSize(name);
   UInt8* outgoingData = new UInt8[size];
   outgoingData[0] = static_cast<UInt8>(SEND_UID_AND_NAME);
   UInt32 offset = 1;
   iviLink::stringToBuffer(uid.value(), outgoingData + offset, true);
   offset += iviLink::stringInBufSize(uid.value());
   iviLink::stringToBuffer(name, outgoingData + offset, true);

   iviLink::Channel::sendBuffer(mChannelID, outgoingData, size);
   delete[] outgoingData;
}
示例#3
0
bool CTrustList::isKnownUid(iviLink::BaseUid const& uid) const
{
	LOG4CPLUS_TRACE_METHOD(msLogger, __PRETTY_FUNCTION__);
	tNameUidVector vec;
	tNameUidVector::iterator i;
	BaseError err = mpStorage->readAll(vec);
	if (!err.isNoError())
	{
		LOG4CPLUS_ERROR(msLogger, static_cast<std::string>(err));
		return false;
	}
	LOG4CPLUS_INFO(msLogger, "Looking for: " + uid.value());

	for(i = vec.begin(); i != vec.end(); ++i)
	{
		if(uid == i->first) return true;
	}
	return false;
}