void MKeyOverride::setEnabled(bool enabled) { Q_D(MKeyOverride); if (d->enabled != enabled) { d->enabled = enabled; emit keyAttributesChanged(keyId(), Enabled); } }
void MKeyOverride::setIcon(const QString &icon) { Q_D(MKeyOverride); if (d->icon != icon) { d->icon = icon; emit keyAttributesChanged(keyId(), Icon); } }
void MKeyOverride::setHighlighted(bool highlighted) { Q_D(MKeyOverride); if (d->highlighted != highlighted) { d->highlighted = highlighted; emit keyAttributesChanged(keyId(), Highlighted); } }
void MKeyOverride::setLabel(const QString &label) { Q_D(MKeyOverride); if (d->label != label) { d->label = label; emit keyAttributesChanged(keyId(), Label); } }
const std::string & AbstractPrimitiveInputAdaptor::valueByKey(const std::string & key) const { for (int i = 0; i < tagsSize(); ++i) { if (m_Controller->queryStringTable(keyId(i)) == key) return m_Controller->queryStringTable(valueId(i)); } return m_Controller->queryStringTable(NULL_STRING_ID); // return "null" string }
GMPErr ClearKeyDecryptionManager::Decrypt(uint8_t* aBuffer, uint32_t aBufferSize, const GMPEncryptedBufferMetadata* aMetadata) { CK_LOGD("ClearKeyDecryptionManager::Decrypt"); KeyId keyId(aMetadata->KeyId(), aMetadata->KeyId() + aMetadata->KeyIdSize()); if (!HasKeyForKeyId(keyId)) { return GMPNoKeyErr; } return mDecryptors[keyId]->Decrypt(aBuffer, aBufferSize, aMetadata); }
void IdDetailsDialog::sendInvite() { /* create a message */ MessageComposer *composer = MessageComposer::newMsg(); composer->setTitleText(tr("You have a friend invite")); RsPeerId ownId = rsPeers->getOwnId(); RetroShareLink link = RetroShareLink::createCertificate(ownId); RsGxsId keyId(ui->lineEdit_KeyId->text().toStdString()); QString sMsgText = inviteMessage(); sMsgText += "<br><br>"; sMsgText += tr("Respond now:") + "<br>"; sMsgText += link.toHtml() + "<br>"; sMsgText += "<br>"; sMsgText += tr("Thanks, <br>") + QString::fromUtf8(rsPeers->getGPGName(rsPeers->getGPGOwnId()).c_str()); composer->setMsgText(sMsgText); composer->addRecipient(MessageComposer::TO, RsGxsId(keyId)); composer->show(); }
RPointerArray<CX509Certificate> PkiUtil::GetCaCertListL(RPKIServiceAPI& aPkiService, const CArrayFixFlat<TCertInfo*>& aIkeCAList) { __ASSERT_ALWAYS(aIkeCAList.Count() > 0, User::Invariant()); _LIT8(KEmptyString, ""); RPointerArray<CX509Certificate> certificateArray; ResetAndDestroyPushL(certificateArray); RArray<TUid> applUidArray; CleanupClosePushL(applUidArray); for (TInt i = 0; i < aIkeCAList.Count(); ++i) { const TCertInfo* certInfo = aIkeCAList[i]; switch(certInfo->iFormat) { case CA_NAME: { // Reserve enough space for UTF-8 TInt len = 3*( certInfo->iData.Length() ); HBufC8* caName = HBufC8::NewLC(len); TPtr8 caNamePtr(caName->Des()); if (CnvUtfConverter::ConvertFromUnicodeToUtf8(caNamePtr, certInfo->iData) != 0) { User::Leave(KErrCorrupt); } CX509Certificate* cert = ReadCertificateLC(aPkiService, KEmptyString, *caName, KEmptyString, EPKICACertificate); User::LeaveIfError(certificateArray.Append(cert)); CleanupStack::Pop(cert); CleanupStack::PopAndDestroy(caName); } break; case KEY_ID: { TPKIKeyIdentifier keyId(NULL); for (TInt j = 0; j < certInfo->iData.Length(); j += 2) { TPtrC hexByte(certInfo->iData.Mid(j, 2)); TLex lex(hexByte); TUint8 value; User::LeaveIfError(lex.Val(value, EHex)); keyId.Append(&value, 1); } CX509Certificate* cert = ReadCertificateLC(aPkiService, keyId); User::LeaveIfError(certificateArray.Append(cert)); CleanupStack::Pop(cert); } break; case APPL_UID: { TLex lex(certInfo->iData); TUint32 value; User::LeaveIfError(lex.Val(value, EHex)); TUid id = { value }; User::LeaveIfError(applUidArray.Append(id)); } break; default: User::Leave(KErrArgument); break; } } if (applUidArray.Count() > 0) { CArrayFix<TCertificateListEntry>* certListArray = NULL;; aPkiService.ListApplicableCertificatesL(applUidArray, certListArray); CleanupStack::PushL(certListArray); if (certListArray->Count() == 0) { User::Leave(KErrNotFound); } for (TInt i = 0; i < certListArray->Count(); ++i) { TCertificateListEntry entry = (*certListArray)[i]; if (entry.iOwnerType == EPKICACertificate) { CX509Certificate* cert = ReadCertificateLC(aPkiService, KEmptyString, entry.iIdentitySubjectName, KEmptyString, EPKICACertificate); User::LeaveIfError(certificateArray.Append(cert)); CleanupStack::Pop(cert); } } CleanupStack::PopAndDestroy(certListArray); } CleanupStack::PopAndDestroy(); //applUidArray CleanupStack::Pop(); return certificateArray; }
const std::string & AbstractPrimitiveInputAdaptor::key(int index) const { return m_Controller->queryStringTable(keyId(index)); }