MCPcopy Create free account
hub / github.com/altairwei/WizNotePlus / getUserCipher

Function getUserCipher

src/share/WizObjectOperator.cpp:784–806  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

782
783
784bool getUserCipher(WizDatabase& db, const WIZDOCUMENTDATA& encryptedDoc)
785{
786 if (encryptedDoc.strGUID.isEmpty())
787 {
788 WizMessageBox::warning(qApp->activeWindow(), QObject::tr("Info"), QObject::tr("Encrypted notes are not downloaded to local, "
789 "can not verify password!"));
790 return false;
791 }
792
793 db.loadUserCert();
794 if (!db.QueryCertPassword())
795 return false;
796
797 if (db.isDocumentDownloaded(encryptedDoc.strGUID))
798 {
799 if (!db.isFileAccessible(encryptedDoc))
800 {
801 WizMessageBox::warning(qApp->activeWindow(), QObject::tr("Info"), QObject::tr("Password error!"));
802 return false;
803 }
804 }
805 return true;
806}
807
808bool WizAskUserCipherToOperateEncryptedNotes(const QString& sourceFolder, WizDatabase& db)
809{

Calls 5

isEmptyMethod · 0.80
loadUserCertMethod · 0.80
QueryCertPasswordMethod · 0.80
isDocumentDownloadedMethod · 0.80
isFileAccessibleMethod · 0.45

Tested by

no test coverage detected